Skip to content

Speech-to-text (long recordings)

$0.20 per callUSDC via x402POST /api/transcribe-long

Long-recording tier (model-backed, gpt-transcribe, the same model as the other transcribe tiers): transcribes an audio file at a URL. Send POST /api/transcribe-long with the required field url and pay $0.20 per call over x402 with USDC on an EVM chain or MPP. It returns a JSON object with model, provider, text, language and duration.

Max 30 minutes and 25 MB (thirty minutes fit at up to about 110 kbps; a file that needs converting is sent as 16 kHz mono Opus). Returns the transcript text, language and duration; diarize:true adds speaker labels, word timestamps and a language confidence score (the scribe-v2 model, same price and cap). No API key needed; pay per call via x402. A file whose length cannot be confirmed is transcribed up to the cap, and the answer says so (trimmedToCapSeconds, durationUnconfirmed). A transient upstream failure gets one more attempt inside the same time limit, and an answer served that way says so in agent402_retried. Takes up to 230 seconds to answer: send the paid call with "Prefer: respond-async" to get a job link at once and collect the answer from it (on x402 the payment settles only on a delivered result), or with "Prefer: wait=230" and keep the connection open for at least 260 seconds, because a client that disconnects first loses the answer. A paid call with neither header is answered 400 before any payment is taken.

Category: AI & computeTags: stt speech-to-text transcription audio whisper openai gpt-transcribe long-audio

Try in playground →

Parameters

NameTypeRequiredDescription
urlstringyesURL of the audio file to transcribe (mp3, wav, m4a, ogg, flac, webm), up to 30 minutes and 25 MB Also accepted as link, uri, href, page.
languagestringnoOptional ISO-639-1 language code (e.g. 'en', 'es', 'fr') for better accuracy
diarizebooleannotrue: transcribe with the scribe-v2 model and add speaker labels and word timestamps (`words`, `speakers`) and `language_confidence` (0 to 1, the model's confidence in the detected language). Same price and cap. Default false
modelstringnoOptional: a model to transcribe with in place of gpt-transcribe, one of mistralai/voxtral-mini-transcribe-3-0, mistralai/voxtral-small-transcribe-3-0 (model-backed; same price and cap; not with diarize). The answer names the model that served it.

Example request

curl -i -X POST https://agent402.tools/api/transcribe-long \
  -H "Content-Type: application/json" \
  -d '{"url":"https://agent402.tools/fixtures/sample-speech.wav"}'

Without payment this returns HTTP 402 Payment Required with the exact price for transcribe-long; any x402 v2 or MPP client pays it and retries.

Watch a call get paid

RequestPOST /api/transcribe-long
402$0.20 USDC
SignPAYMENT-SIGNATURE
Settleon 11 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "model": "gpt-transcribe",
  "provider": "openai",
  "text": "Hi, this is the Agent402 sample recording. Can you hear me clearly? Yes, loud and clear. There are two of us on this clip, so the transcript can tell us apart.",
  "language": "en",
  "duration": 12.6
}
FieldTypeAlways presentIn the example
modelstringyesgpt-transcribe
providerstringyesopenai
textstringyesHi, this is the Agent402 sample recording. Can you hear me clearly? Yes, loud...
languagestringyesen
durationnumberyes12.6
trimmedToCapSecondsnumbernoPresent only when the file's length could not be confirmed: the audio was transcribed up to this many seconds (the tier's cap)
durationUnconfirmedbooleannoPresent (true) only with trimmedToCapSeconds: the file's full length was not confirmed

From an MCP client

catalog.call {
  "slug": "transcribe-long",
  "params": {
    "url": "https://agent402.tools/fixtures/sample-speech.wav"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for transcribe-long; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.15.0.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.20" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/transcribe-long", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "url": "https://agent402.tools/fixtures/sample-speech.wav"
  }),
});

Related tools

Speech-to-text

$0.03POST /api/transcribe

Transcribe audio to text with the gpt-transcribe model.

Speech-to-text (Pro)

$0.10POST /api/transcribe-pro

Pro tier for longer recordings (model-backed, gpt-transcribe, the same model as the standard tier): transcribes an audio.

Transcribe (OpenAI-compatible)

$0.03POST /v1/audio/transcriptions

OpenAI's own transcription wire: POST multipart/form-data with a `file` part and get the transcript back.

Speech-to-text, long audio (OpenAI transcription wire)

$0.10POST /v1/pro/audio/transcriptions

OpenAI's transcription wire on the ten-minute tier: POST multipart/form-data with a `file` part.

Decisions (OpenAI wire)

$0.001POST /v1/decisions

OpenAI's Decisions API on its own wire: point an OpenAI SDK's base URL here and client.decisions.create works unchanged.

Dub: translate and speak

from $0.14POST /api/dub

Translate a text into a target language and speak the translation, in one paid call.