AI Voice Agent API Cost: STT, LLM and TTS on One Ofox Bill

Transcription of a 7.64-second recording billed as eight seconds, a two-sentence answer and 9.32 seconds of synthesized speech added up to $0.0102885 for one support turn.

A long paper ribbon showing a voice conversation: dense sound bars while people talk, and an orange switch where the line becomes a quiet dotted stretch

Transcription of a 7.64-second recording billed as eight seconds, a two-sentence answer and 9.32 seconds of synthesized speech added up to $0.0102885 for one support turn. The text model accounted for 73.6% of the bill and took 41.5 seconds to return its answer. For this pipeline, start latency tuning at the text step.

The pipeline at a glance

StepOfox endpointModelBilled byOur measured result
1. Transcribe the callerPOST /v1/audio/transcriptionsopenai/gpt-transcribeSeconds of input audio8 s billed, $0.0006, 3.6 s
2. AnswerPOST /v1/chat/completionsgoogle/gemini-4-neonInput and output tokens (thinking counts as output)74 in / 490 out, $0.0076, 41.5 s
3. Speak the answerPOST /v1/audio/speechgoogle/gemini-3.8-flash-ttsText input tokens and audio output tokens39 in / 233 out, $0.0021, 4.7 s

Step 1: Transcribe the caller

from openai import OpenAI

client = OpenAI(base_url="https://api.ofox.ai/v1", api_key="YOUR_OFOX_API_KEY")

with open("question.wav", "rb") as f:
    transcript = client.audio.transcriptions.create(model="openai/gpt-transcribe", file=f)
question = transcript.text

The 7.64-second question was billed as 8 seconds for $0.0006. The request took 3.6 seconds. See the transcription cost guide for budgeting.

The transcript was accurate, with one detail worth planning for: the order number came back spelled out as “A dash one zero four two”. Neon still read it as A-1042, but if your code extracts IDs with a pattern such as A-\d+, normalise spelled-out characters and digits first, or ask the model to return the ID in a structured field.

Step 2: Answer with a chat model

reply = client.chat.completions.create(
    model="google/gemini-4-neon",
    messages=[
        {"role": "system", "content": "You are a concise support agent. Answer in two short sentences."},
        {"role": "user", "content": question},
    ],
    max_tokens=1024,
)
answer = reply.choices[0].message.content

Of 490 output tokens, 447 were reasoning tokens (91.2%). The reply offered a refund although the request had no refund tool. Route that action through the order system and confirm success before announcing it to the caller.

Step 3: Speak the answer

with client.audio.speech.with_streaming_response.create(
    model="google/gemini-3.8-flash-tts",
    voice="Kore",
    input=answer,
    response_format="wav",
) as resp:
    resp.stream_to_file("answer.wav")

The speech endpoint returned a 9.32-second, 24 kHz mono WAV in 4.7 seconds. The November 20 log lists 39 text input tokens, 233 audio output tokens and a charge of $0.0021165.

What one turn costs

Three billed stages: transcription, text generation and speech synthesis.

StepBilledShareWall-clock time
Transcribe 8 s question$0.00065.8%3.6 s
Gemini 4 Neon answer$0.007673.6%41.5 s
Speak 9.3 s answer$0.002120.6%4.7 s
Turn total$0.010349.8 s

Test a faster text model without changing the voice

Keep the transcript, system message, output limit and TTS voice fixed. In the Step 2 request, replace only the model ID with a low-latency chat model enabled for your Ofox account. Alternate the two models on the same questions. Record time to the complete answer, total billed cost and whether the reply preserves the order ID. Reject any answer that claims a refund without a successful transaction.

Test streaming separately. Time from the end of the question to the first audible reply in the client. A faster first text token helps only if your application starts synthesis and playback before the full reply arrives.

Errors you may hit

SymptomLikely causeFix
401 Invalid or expired API keyIn this test the key was copied from the masked list in the dashboard; the full key is shown only once, in the creation dialogCreate a new key and use the copy button in the creation dialog; see our AI API error handling guide
Slow responseThe text step took 41.5 s in the recorded turnTime each stage and record first audible playback
IDs come back as “A dash one zero four two”Transcription spells out characters and digitsNormalise before pattern matching, or extract IDs with the model into a structured field
The agent promises refunds or changes it never madeNo tool, or no rule tying promises to tool resultsAdd real tools and only speak confirmed actions

Method

One sequential Ofox turn on November 20, 2026. The setup call that synthesized the caller’s question is excluded. Stage durations measure completed requests; the client did not record first audible playback.

Frequently Asked Questions

How much did each stage cost?
Transcription cost $0.0006, text generation $0.007572 and speech synthesis $0.0021165, for a total of $0.0102885 for this turn.
How many audio tokens represented one second?
The TTS response recorded 233 output tokens for 9.32 seconds of audio, or about 25 per second in this sample.