# Cueito speech-to-text API: integration facts - Base URL: https://api.cueito.com/v1 - Docs: https://cueito.com/docs - API keys: created at https://cueito.com/dashboard/keys; they start with "cueito_sk_live_" (older keys: "cueito_sk_"). - Auth: header "Authorization: Bearer ". Keep the key server-side only (env var CUEITO_API_KEY). Never ship it to a browser or mobile app. - Compatibility: the API is wire-compatible with OpenAI's audio endpoints. The official OpenAI SDKs (Python "openai", Node "openai") work by setting base_url/baseURL to https://api.cueito.com/v1 and model to "wapi-v1". - Model: "wapi-v1" (the only model; GET /models lists it). ## Endpoints POST /audio/transcriptions (multipart/form-data) speech -> text in the spoken language POST /audio/translations (multipart/form-data) speech in any language -> English text GET /models, GET /models/wapi-v1 ## Form fields - file (required): the audio. The filename MUST end in a supported extension: mp3, mp4, m4a, wav, webm, ogg, flac. The format is detected from the extension, so always pass a filename (e.g. Blob + "audio.webm"). - model (required): "wapi-v1" - language (optional, transcriptions only): ISO 639 code or BCP-47 tag such as "en", "hi" or "hi-IN" (region is ignored). Omit it or send "auto" to auto-detect. Unsupported languages return 400. - prompt (optional): up to 2000 characters of context or vocabulary (names, jargon) to guide spelling. An instruction prompt (e.g. "Transcribe this phone call verbatim in Hinglish, Roman script, never Devanagari; label speaker turns as 'Agent:' and 'Customer:' on new lines") is read by the API instead of being sent to the decoder: it fills in language=hinglish, output_script=roman, audio_type=call and mode=verbatim when those fields are not sent, and the transcript text comes back as one "Agent: ..." / "Customer: ..." line per turn using the label names you quoted. Explicit fields always win. The response header x-prompt-applied lists what the prompt turned on. - response_format (optional, default "json"): json, text, srt, vtt, verbose_json - temperature (optional, 0 to 1, default 0) - timestamp_granularities[] (optional, transcriptions only): "segment" and/or "word". Only used with response_format=verbose_json. Default ["segment"]. - word_timestamps (optional, "true"/"false"): shorthand for adding "word" to timestamp_granularities. ## Upcoming fields (accepted by the API, but return 400 feature_unavailable until enabled) Do NOT send these in generated code unless the user asks for the feature; then handle feature_unavailable by retrying without the field. - language_hints[] (up to 10 codes), custom_vocabulary (up to 1000 terms), diarization (bool) with min_speakers/max_speakers (1-8), mode ("verbatim" | "smart"), translate_to (language code), output_script ("native" | "roman"), backend ("auto" | "whisper" | "indic"), audio_type ("general" | "call" | "meeting": call labels speakers agent/customer, meeting labels up to 8; both add speaker_stats). language may also be "hinglish" (Hindi + English mixed). - Lists may be repeated fields, a JSON array, or one comma-separated string. With the OpenAI Python SDK pass them via extra_body. ## Responses - json: {"text": "..."} - text / srt / vtt: plain text body (content-type text/plain) - verbose_json: {"task","language","duration","text","segments":[{"id","seek","start","end","text","tokens","temperature","avg_logprob","compression_ratio","no_speech_prob"}],"words":[{"word","start","end","confidence"}]}, plus "language_probability" when the language was auto-detected. Times are seconds as floats; confidence is 0-1. Ignore unknown keys: responses may gain fields (speakers, translation, warnings). ## Limits - Max upload 25 MB per request (larger files: re-encode to mono 16 kHz 64 kbps MP3 or split into chunks). - A request waits up to 120 seconds for the transcript; long files can return job_timeout (504). Split long audio into chunks (e.g. 10 minutes) and offset the timestamps. - Rate limits are per API key: requests per minute plus a cap on jobs running at the same time (defaults 60/min and 2 concurrent; plans can raise them). Response headers: x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests. 429 responses include retry-after (seconds). - Billing: per second of audio, prepaid from the account wallet. Failed requests are not charged. ## Errors Body: {"error":{"message","type","code","param?"}}. Every response has an x-request-id header; log it. - 400 invalid_request, unsupported_format: fix the request, do not retry - 400 feature_unavailable: the field named in "param" isn't enabled yet; resend without it - 401 invalid_api_key: check the key, do not retry - 402 insufficient_credits: wallet balance too low, or the key hit its monthly spend limit; top up or raise the limit in the dashboard (falling back to another provider is reasonable) - 403 account_suspended: contact support - 404 model_not_found, not_found - 413 file_too_large, audio_too_long: compress or split - 429 rate_limited: wait retry-after seconds, then retry - 500 internal_error, 503 worker_unavailable / maintenance_mode, 504 job_timeout: retry with exponential backoff, or fail over to another provider ## Conventions for generated code - Read CUEITO_API_KEY (and optionally CUEITO_BASE_URL defaulting to https://api.cueito.com/v1) from environment variables. - Prefer the OpenAI SDK pointed at the base URL; plain HTTP multipart works everywhere else. - Set a client timeout of at least 150 seconds. - Retry 429/5xx with exponential backoff and jitter (max 3 attempts), honour retry-after, never retry 4xx other than 429. - Log the x-request-id of failed calls.