Skip to main content

Speech to Text API

Upload one audio file and receive a completed transcript as JSON or plain text. The multipart fields and response use a familiar OpenAI transcription shape, but the endpoint is different, so changing only an OpenAI SDK Base URL is not supported.

API overview

ItemValue
Base URLhttps://api.kitschlabs.com
EndpointPOST /v1/speech-to-text
AuthenticationAuthorization: Bearer <API_KEY> or xi-api-key: <API_KEY>
Requestmultipart/form-data
Modelkitsch-stt-v1
Maximum file size100 MiB
Default responseJSON

Speech to Text is enabled by default for every authenticated account.

How do I transcribe a file?

curl --request POST \
"https://api.kitschlabs.com/v1/speech-to-text" \
--header "Authorization: Bearer <API_KEY>" \
--form "file=@speech.wav" \
--form "model=kitsch-stt-v1" \
--form "language=en" \
--form "response_format=json"

What fields can I send?

FieldTypeRequiredDescription
filefileYesAudio file to transcribe, up to 100 MiB
modelstringYeskitsch-stt-v1
languagestringNoExpected ISO 639-1 language code, such as ko, en, or ja
promptstringNoShort hint for proper nouns or context
response_formatstringNojson (default) or text
streambooleanNoOnly false is supported
kitsch_optionsJSON stringNoAdvanced recognition options

temperature, stream=true, other model IDs, and unsupported response formats return an error. To send audio as it is produced, use the Streaming API.

Advanced options

Send kitsch_options as a JSON string. Supported keys are:

  • language_hints, language_hints_strict
  • enable_speaker_diarization
  • enable_language_identification
  • context
  • translation
--form 'kitsch_options={"language_hints":["ko","en"],"enable_speaker_diarization":true}'

Unknown keys return an error.

What does the response look like?

Response with response_format=json:

{
"text": "Hello.",
"usage": {
"type": "duration",
"seconds": 1.25
}
}

With response_format=text, the API returns UTF-8 plain text. Record the x-kitsch-request-id response header for support and incident investigation.

How is usage billed?

Successful requests are billed at 0.1 credits per started second of input audio. For example, 4.2 and 5.0 seconds each cost 0.5 credits, while 5.1 seconds costs 0.6 credits. Failed requests and requests rejected during input validation are not charged.

How should I handle errors?

The error body includes error.message, error.type, error.param, and error.code.

{
"error": {
"message": "The uploaded file is too large.",
"type": "invalid_request_error",
"param": "file",
"code": "file_too_large"
}
}
StatusMeaningRecommended action
400 or 422Invalid file, model, or optionCheck the fields and audio file
401Missing or invalid API keyCheck the authentication header
402Insufficient creditsCheck the balance and billing status
413File exceeds the size limitReduce the file to 100 MiB or less
429Request or processing capacity limitFollow Retry-After and apply backoff
503Temporarily unavailableRecord the request ID and retry selectively