页面简介
Transcribes an audio file of any length
正文摘录
Batch Speech-to-TextcURLcurl --request POST \ --url https://api.cartesia.ai/stt \ --header 'Authorization: Bearer <token>' \ --header 'Cartesia-Version: <cartesia-version>' \ --header 'Content-Type: multipart/form-data' \ --form file=@example-file \ --form model=ink-whisper \ --form language=en \ --form 'timestamp_granularities[]=word'200{ "type": "transcript", "text": "<string>", "request_id": "<string>", "language": "<string>", "duration": 123, "words": [ { "word": "<string>", "start": 123, "end": 123 } ] }POST/sttTry itBatch Speech-to-TextcURLcurl --request POST \ --url https://api.cartesia.ai/stt \ --header 'Authorization: Bearer <token>' \ --header 'Cartesia-Version: <cartesia-version>' \ --header 'Content-Type: multipart/form-data' \ --form file=@example-file \ --form model=ink-whisper \ --form language=en \ --form 'timestamp_granularities[]=word'200{ "type": "transcript", "text": "<string>", "request_id": "<string>", "language": "<string>", "duration": 123, "words": [ { "word": "<string>", "start": 123, "end": 123 } ] }AuthorizationsAPIKeyAuthAccessTokenAuthAuthorizationstringheaderdefault:$CARTESIA_API_KEYrequiredCartesia API key (sk_car_...). Get one at play.cartesia.ai/keys.HeadersCartesia-Versionenum<string>default:2026-08-14requiredAPI version header.Available options: 2026-08-14 Example:"2026-08-14"Query Parametersencodingenum<string> | nullRequired when you upload raw PCM data without a container header. If you leave it out, the server decodes the audio automatically from its container, such as WAV, MP3, or FLAC. Must match the actual encoding of your audio. For detailed guidance on each format, see Audio Input.Available options: pcm_s16le, pcm_s32le, pcm_f16le, pcm_f32le, pcm_mulaw, pcm_alaw sample_rateinteger | nullThe sample rate of the audio in Hz, from 8000 to 48000Bodymultipart/form-datafilefilerequiredYou don't need to split your audio file. The server splits long files into chunks for you. Supported audio formats: flac, m4a, mp3, mp4, mpeg, mpga, oga, ogg, wav, webmmodelenum<string>requiredID of the model to use for transcription. Must be in the ink-whisper family of models.Available options: ink-whisper Example:"ink-whisper"languageenum<string>default:enThe language code of the input audio. If you leave it out, it defaults to en, and speech in other languages can come back translated into English.Available options: en, zh, de, es, ru, ko, fr, ja, pt, tr, pl, ca, nl, ar, sv, it, id, hi, fi, vi, he, uk, el, ms, cs, ro, da, hu, ta, no, th, ur, hr, bg, lt, la, mi, ml, cy, sk, te, fa, lv, bn, sr, az, sl, kn, et, mk, br, eu, is, hy, ne, mn, bs, kk, sq, sw, gl, mr, pa, si, km, sn, yo, so, af, oc, ka, be, tg, sd, gu, am, yi, lo, uz, fo, ht, ps, tk, nn, mt, sa, lb, my, bo, tl, mg, as, tt, haw, ln, ha, ba, jw, su, yue timestamp_granularities[]enum<string>[]The granularity of timestamps to include in the response. Currently, only word is supported. It returns the start and end time of each word.Available options: word Response200 - application/jsontypeenum<string>requiredThe message type. Always transcript for a batch transcription response.Available options: transcript textstringrequiredThe transcribed text. A batch response is always the complete transcription.request_idstringUnique identifier for this transcription requestlanguagestringThe specified language of the input audiodurationnumber<double>The duration of the input audio in secondswordsTranscriptionWord · object[]The start and end time of each word. Included only when you pass [word] in timestamp_granularities[].Show child attributesWas this page helpful?YesNo