Speech Endpoints

The speech tools turn recordings into text and text into speech. They are part of All tools:

  • speech.transcribe returns the text of an audio or video file with a timestamp for each segment, the language and the length, plus SRT and WebVTT subtitle files. It can label who says what and translate the transcript.
  • speech.synthesize reads a text aloud in one of 13 voices and returns an MP3 or WAV file.

A start needs the scope and enough credits, and the tool must be available in /v1/health. Free credits also follow the free limits. Accepted starts return 202 Accepted; poll their status.

All speech endpoints are preview. Preview means the contract may still evolve before stable release.

Shared Access

  • Access: Paid plans that include this family, or free credits (guest trial or verified account) within the free limits.
  • Operation family: Speech
  • Scope: api:convert:write, the same scope as file conversion
  • Idempotency: Idempotency-Key header required

Sources

speech.transcribe reads a source, like the document tools:

{ "source": { "type": "url", "url": "https://upload.wikimedia.org/wikipedia/commons/6/6f/Apollo13-wehaveaproblem.ogg" } }
  • {"type": "file_id", "id": "fil_..."}: a file you uploaded with POST /v1/files or the hosted MCP upload link. Wait until the file is available.
  • {"type": "artifact_id", "id": "art_..."}: an artifact of an earlier operation, such as an audio file from speech.synthesize.
  • {"type": "url", "url": "https://..."}: a public https URL. Chab downloads the file when the operation runs, with the same address checks as the scrape tools, and checks it for viruses like an upload. The download may be as large as your plan's upload size (2 MiB on free credits, 25 MiB on paid plans, 100 MiB on Scale). The URL is stored encrypted; results show it without its query.

It reads MP3, M4A, WAV, OGG (Opus and Vorbis), FLAC, WebM, MP4 and MOV files. Chab reads the type from the file itself. From a video only the sound is read. A URL that returns a web page fails with unsupported_file_type and costs nothing, and so does a file without sound (unsupported_file_content).

Pricing

speech.transcribe costs 5 credits per started minute of the recording that was read, or 20 credits a minute with speakers. A recording of 60.5 seconds counts as one minute. A translation (translate_to) adds its tokens, 0.1 credit per 1,000 input tokens and 0.4 per 1,000 output tokens, which is about 1 credit for a few minutes. With speakers and no language, Chab checks the language with a few hundred tokens of the same model.

Chab reserves credits for max_minutes and charges the minutes it read. Without max_minutes, an uploaded file or an artifact reserves for the longest it could be from its size (at most 120 minutes), and a URL reserves 30 minutes: a longer recording from a URL is transcribed up to 30 minutes, with a warning that gives its full length. Set max_minutes to read more, or to keep the hold small.

speech.synthesize costs the tokens it uses: 0.5 credit per 1,000 text tokens and 9.7 credits per 1,000 audio tokens, rounded up once per request, at least 1 credit. 1,000 characters are about a minute of speech and cost about 15 credits. Chab reserves credits for 4 audio tokens per character (more at a lower speed) and charges what was used.

A request that fails before any audio is read or spoken costs nothing.

See Credits and Billing.

POST/v1/speech/transcribe

Returns the text of a recording or a video, in its own language, split into segments with their start and end in seconds. Long recordings are read in parts of ten minutes, several at a time, and joined on the recording's clock. You also get the transcript as SRT and WebVTT subtitle files.

Required Access

  • Credits: reserved for max_minutes (or what the file can hold, 30 minutes for a URL), charged per started minute read.
  • Scope: api:convert:write

Request

{
  "source": {
    "type": "url",
    "url": "https://upload.wikimedia.org/wikipedia/commons/6/6f/Apollo13-wehaveaproblem.ogg"
  },
  "max_minutes": 1
}

Curl example:

curl -X POST https://www.chab.ai/v1/speech/transcribe \
  -H "Authorization: Bearer CHAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: apollo-13-001" \
  -d '{"source":{"type":"url","url":"https://upload.wikimedia.org/wikipedia/commons/6/6f/Apollo13-wehaveaproblem.ogg"},"max_minutes":1}'

Fields:

  • source: required, see Sources.
  • language: optional ISO 639-1 code of the language spoken, such as en or de. Chab finds the language itself; giving it helps with short or noisy recordings.
  • speakers: optional, default false. Set true to label who says what: every segment gets a speaker (A, B, C...). It costs 20 credits a minute.
  • translate_to: optional ISO 639-1 code. Every segment also gets a translation in that language, and you get subtitle files in it too.
  • max_minutes: optional, 1 to 120. Chab transcribes at most this many minutes from the start. Without it a URL is read for up to 30 minutes, a file for up to 120.
  • callback_url, callback_secret, callback_events, and callback_notify_on_expiration: optional one-off operation callback fields.

Transcription Result

{
  "data": {
    "result": {
      "source": {
        "type": "url",
        "url": "https://upload.wikimedia.org/wikipedia/commons/6/6f/Apollo13-wehaveaproblem.ogg",
        "filename": "Apollo13-wehaveaproblem.ogg",
        "format": "ogg",
        "byte_size": 3644189
      },
      "duration_seconds": 178.66,
      "transcribed_seconds": 60,
      "language": "en",
      "speakers": null,
      "text": "Okay, Houston. We've had a problem here. This is Houston. Say again, please. Houston, we've had a problem. We've had a main beam undervolt. Roger. Main beam undervolt...",
      "translation": null,
      "segment_count": 14,
      "segments": [
        { "start": 0, "end": 5, "speaker": null, "text": "Okay, Houston. We've had a problem here." },
        { "start": 5, "end": 7, "speaker": null, "text": "This is Houston. Say again, please." },
        { "start": 7, "end": 10, "speaker": null, "text": "Houston, we've had a problem." },
        { "start": 10, "end": 13, "speaker": null, "text": "We've had a main beam undervolt." }
      ],
      "files": [
        { "filename": "Apollo13-wehaveaproblem.srt", "format": "srt", "language": null },
        { "filename": "Apollo13-wehaveaproblem.vtt", "format": "vtt", "language": null }
      ],
      "usage": { "audio_seconds": 60 }
    },
    "artifacts": [
      { "id": "art_...", "type": "srt", "role": "subtitles", "mime_type": "application/x-subrip", "filename": "Apollo13-wehaveaproblem.srt", "download_url": "/v1/operations/op_.../artifacts/art_.../download" },
      { "id": "art_...", "type": "vtt", "role": "subtitles", "mime_type": "text/vtt", "filename": "Apollo13-wehaveaproblem.vtt", "download_url": "/v1/operations/op_.../artifacts/art_.../download" }
    ],
    "warnings": [
      {
        "code": "partial_results",
        "message": "The recording is 3 minutes long; the first minute was transcribed. Send max_minutes: 3 to transcribe all of it.",
        "field": "max_minutes",
        "severity": "warning"
      }
    ],
    "result_expires_at": "2026-11-19T13:48:12+00:00"
  },
  "meta": {
    "request_id": "req_123"
  }
}

This first minute of the Apollo 13 radio recording cost 5 credits. The SRT file starts like this:

1
00:00:00,000 --> 00:00:05,000
Okay, Houston. We've had a problem here.

2
00:00:05,000 --> 00:00:07,000
This is Houston. Say again, please.

Speakers and translation

With "speakers": true and "translate_to": "de", a minute of a NASA podcast interview, uploaded as an MP3 file, came back like this (shortened). It cost 21 credits: 20 for the minute and 1 for the translation.

{
  "language": "en",
  "speakers": ["A", "B", "C"],
  "segments": [
    { "start": 30.456, "end": 34.306, "speaker": "A", "text": "Tracy, welcome to Houston We Have a Podcast. We are so happy to have you here.", "translation": "Tracy, willkommen bei Houston We Have a Podcast. Wir freuen uns sehr, Sie hier zu haben." },
    { "start": 34.306, "end": 35.906, "speaker": "C", "text": "Thank you. It's my pleasure.", "translation": "Danke. Es ist mir eine Freude." }
  ],
  "translation": { "language": "de", "text": "Wie das Leben an Bord der Raumstation wirklich ist..." },
  "files": [
    { "filename": "nasa-podcast-interview.srt", "format": "srt", "language": null },
    { "filename": "nasa-podcast-interview.vtt", "format": "vtt", "language": null },
    { "filename": "nasa-podcast-interview.de.srt", "format": "srt", "language": "de" },
    { "filename": "nasa-podcast-interview.de.vtt", "format": "vtt", "language": "de" }
  ]
}

With speakers, text starts a new line when the speaker changes, and the subtitles name the speaker (Speaker A: ... in SRT, <v Speaker A> in WebVTT). A recording longer than ten minutes is read in parts: Chab sends a short voice sample of the main speakers of the first part with the others, so a speaker keeps the same letter. A speaker who first talks later can get a new letter in each part.

Speaker detection needs clear speech. In a noisy recording, such as old radio, the parts where speakers cannot be told apart come back without a speaker, with a field_unavailable warning, and those minutes cost 5 credits instead of 20.

Other cases

  • A recording longer than max_minutes (or than 120 minutes) is transcribed from the start up to that point, with a partial_results warning.
  • A part that cannot be transcribed is left out, with a partial_results warning that names its time; you do not pay for it. When nothing can be transcribed the operation fails with provider_unavailable and costs nothing.
  • A very long transcript (over about 600 KB of segments) has the first 500 segments in the result, segments_in_file set to true, and every segment in the transcript-segments.jsonl artifact.

POST/v1/speech/synthesize

Reads a text aloud and returns the audio as an artifact. A text longer than 2,500 characters is read in parts, cut at the end of a sentence, and joined into one file.

Required Access

  • Credits: reserved for the length of the text, charged on the tokens used.
  • Scope: api:convert:write

Request

{
  "text": "Hello! This is Chab reading your text aloud. You can pick a voice and tell it how to sound.",
  "voice": "marin",
  "format": "mp3"
}

Curl example:

curl -X POST https://www.chab.ai/v1/speech/synthesize \
  -H "Authorization: Bearer CHAB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: hello-speech-001" \
  -d '{"text":"Hello! This is Chab reading your text aloud. You can pick a voice and tell it how to sound.","voice":"marin","format":"mp3"}'

Fields:

  • text: required, up to 20,000 characters.
  • voice: optional, default marin. One of marin, cedar, alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer and verse. marin and cedar sound the most natural. Every voice also reads other languages.
  • instructions: optional, up to 1,000 characters on how the voice should sound, such as "Speak in a calm, friendly voice" or "Read it like a museum guide".
  • format: optional, mp3 (default, mono, 96 kbit/s) or wav (24 kHz, 16-bit, mono).
  • speed: optional, 0.5 to 2, default 1.
  • callback_url, callback_secret, callback_events, and callback_notify_on_expiration: optional one-off operation callback fields.

Speech Result

{
  "data": {
    "result": {
      "voice": "marin",
      "format": "mp3",
      "speed": 1,
      "character_count": 91,
      "characters_read": 91,
      "duration_seconds": 5.7,
      "parts": 1,
      "file": { "filename": "speech.mp3", "mime_type": "audio/mpeg", "byte_size": 69453 },
      "usage": { "input_tokens": 23, "output_tokens": 151 }
    },
    "artifacts": [
      {
        "id": "art_...",
        "type": "audio",
        "role": "speech_audio",
        "mime_type": "audio/mpeg",
        "byte_size": 69453,
        "filename": "speech.mp3",
        "download_url": "/v1/operations/op_.../artifacts/art_.../download"
      }
    ],
    "warnings": [],
    "result_expires_at": "2026-11-19T13:38:39+00:00"
  },
  "meta": {
    "request_id": "req_123"
  }
}

This sentence cost 2 credits (23 text and 151 audio tokens). A text of 3,099 characters in two parts, as WAV with a style instruction, gave 170 seconds of speech for 45 credits. When a later part cannot be read aloud, you get the audio of the parts before it, characters_read says how far it got, and a partial_results warning tells you; you pay for what was read. When the first part fails the operation fails and costs nothing.

Speech Errors

Code When Charge
validation_failed A field is missing or wrong, or the URL is not public https None
not_found, file_expired, source_scan_pending, source_scan_failed The file or artifact cannot be read None
unsupported_file_type Not an MP3, M4A, WAV, OGG, FLAC, WebM, MP4 or MOV file None
unsupported_file_content The file cannot be opened, has no sound, or the recording could not be read None
source_too_large Larger than your plan's upload size None
source_quarantined The file did not pass the virus check None
target_fetch_blocked, target_timeout The URL could not be downloaded None
operation_family_degraded Audio cannot be processed right now; try again later None
provider_unavailable Nothing could be transcribed or read aloud right now; try again later None