Create a new job
https://eu1.asr.api.speechmatics.com/v2/jobsAuthentication
- bearerAuth
Authorization: Bearer <token>Your API key, or a temporary key (JWT).
Query parameters
waitoptionalinteger≥ 0If set, the request blocks for up to this many seconds, waiting for the job to reach a terminal state before responding. The value is capped by a server-side configured limit. The response is always
201because the job record was created. Passingwaitopts in to the extended response: thestatusfield is included and reports whether the job reached a terminal state within the wait. If the wait elapses before the job finishes, the job is returned in its current (non-terminal) state withstatusset tocreated. If the job completes within the wait,statusisdoneand the result is returned under the key named after the selectedformat(json-v2,txt, orsrt); if it is rejected,statusisrejected. Ifwaitis omitted, the legacy response is returned: just the jobid, with nostatusfield.formatoptional"json-v2" | "txt" | "srt"The transcript format returned in the
transcriptfield of the response when the job completes withinwait(by default thejson-v2format is returned). Only relevant whenwaitis set.
Header parameters
X-SM-Processing-DataoptionalstringNote: Only available for on-prem JSON dictionary of processing settings for the job worker. Currently supports
parallel_engines(integer), which controls the number of engines the worker can use in parallel for this job, anduser_id(string), which is the user id for this job. Example:{"parallel_engines": 4}
Request body
configJobConfigThe job's configuration, sent as a JSON string.
data_fileoptionalstring<binary>The data file to be processed. Alternatively the data file can be fetched from a url specified in
JobConfig.
Responses
OK
idstringThe unique ID assigned to the job. Keep a record of this for later retrieval of your completed job.
statusoptionalenumone ofNote: Only available on SaaS on Cloud. Present only when the
waitquery parameter is set. Reports the outcome of the wait, which is distinct from the job lifecycle status returned byGET /jobs/{jobid}.json-v2optionalobjectThe transcript as a JSON object (the Speechmatics JSON v2 transcript — see RetrieveTranscriptResponse), returned verbatim from the stored transcript. Best-effort: present when
statusisdoneandformatwasjson-v2(the default) and the result is readable; if absent, fetch it fromGET /jobs/{id}/transcript.txtoptionalstringThe transcript as plain text. Best-effort: present when
statusisdoneandformatwastxtand the result is readable; if absent, fetch it fromGET /jobs/{id}/transcript.srtoptionalstringThe transcript as SubRip (SRT) subtitles. Best-effort: present when
statusisdoneandformatwassrtand the result is readable; if absent, fetch it fromGET /jobs/{id}/transcript.
import { openAsBlob } from "node:fs";
import { BatchClient } from "@speechmatics/batch-client";
const client = new BatchClient({ apiKey: "YOUR_API_KEY", appId: "my-app" });
// In a browser, pass a File from a file input instead.
const file = new File([await openAsBlob("example.wav")], "example.wav");
const { id } = await client.createTranscriptionJob(file, {
transcription_config: { language: "en", model: "enhanced" },
});
console.log(id);
from speechmatics.batch import Client, TranscriptionConfig
with Client(api_key="YOUR_API_KEY") as client:
job = client.submit_job(
"example.wav",
transcription_config=TranscriptionConfig(language="en", model="enhanced"),
)
print(job.id)
API_KEY="YOUR_API_KEY"
curl -L -X POST "https://eu1.asr.api.speechmatics.com/v2/jobs" \
-H "Authorization: Bearer ${API_KEY}" \
-F data_file=@example.wav \
-F config='{"type": "transcription", "transcription_config": {"language": "en", "model": "enhanced"}}'