Speech-to-text (Pro)

$0.100 per call · USDC via x402 · POST /api/transcribe-pro

Transcribe audio to text using OpenAI (gpt-transcribe) - the same model as /api/transcribe with a longer cap. Send POST /api/transcribe-pro with the required field url and pay $0.100 per call over x402 or MPP (there is no free tier). It returns a JSON object with model, provider, text, language and duration.

Provide a URL to an audio file and get back the transcript; add diarize:true for speaker labels and word timestamps (ElevenLabs Scribe v2). No API key needed; pay per call via x402. Max 10 minutes of audio, 25 MB file size.

Category: AI & compute · Tags: stt speech-to-text transcription audio whisper openai gpt-transcribe pro

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
urlstringyesURL of the audio file to transcribe (mp3, wav, m4a, ogg, flac, webm) Also accepted as link, uri, href, page.
languagestringnoOptional ISO-639-1 language code (e.g. 'en', 'es', 'fr') for better accuracy
diarizebooleannotrue: transcribe with ElevenLabs Scribe v2 and add speaker labels and word timestamps (`words`, `speakers`). Same price and cap. Default false

Example request

curl -i -X POST https://agent402.tools/api/transcribe-pro \
  -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-pro; any x402 v2 or MPP client pays it and retries.

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

From an MCP client

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

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

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?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

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

Related tools

Speech-to-text

$0.030 · POST /api/transcribe

Transcribe audio to text using OpenAI (gpt-transcribe). Provide a URL to an audio file (mp3, wav, m4a, etc.) and get bac…

Speech-to-text (OpenAI transcription wire)

$0.030 · POST /v1/audio/transcriptions

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

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

$0.100 · POST /v1/pro/audio/transcriptions

OpenAI's transcription wire on the ten-minute tier: POST multipart/form-data with a `file` part. Same model as /v1/audio…

Code execution (Pro)

$0.050 · POST /api/code-run-pro

Execute Python or JavaScript code in a secure, isolated cloud sandbox (Pro tier). Same as /api/code-run but with 60s tim…

Decisions (OpenAI wire)

$0.001 · POST /v1/decisions

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

Text embeddings

$0.002 · POST /api/embed

Generate a text embedding vector using OpenAI text-embedding-3-small (1536 dimensions). Ideal for semantic search, RAG, …