Every LLM Gateway response includes a request_id — a unique identifier for that specific request. Log this ID for every call, not just when something goes wrong. When you reach out to support@assemblyai.com, including the request_id lets us find the exact request in our logs in seconds.
At minimum, capture the following for every request:
request_id from the response bodymodel parameter usedllm-gateway.assemblyai.com, EU: llm-gateway.eu.assemblyai.com)A minimal logging example:
Symptom: The API responds with 401 Unauthorized or 403 Forbidden.
Causes:
Authorization header is misspelled (e.g. Authorisation or missing the header entirely).Fixes:
Authorization header — not as a query parameter and not prefixed with Bearer.Symptom: The API responds with 400 Bad Request.
Causes:
model, plus either messages or prompt).model value is not a supported model parameter — see Available models.max_tokens is outside the valid range or exceeds the model’s context window.messages sent as a string instead of an array).Fixes:
Symptom: The API responds with 429 Too Many Requests.
Cause: You exceeded the per-model rate limit within a 60-second window. Each model has its own limit.
Fixes:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) to back off gracefully. See Rate limits for the full header reference.Symptom: The API responds with 404 Not Found and an error mentioning the model.
Causes:
model value is misspelled or has been deprecated.Fixes:
Symptom: The API responds with 500, 502, 503, or 504.
Causes:
Fixes:
request_id, the model used, the timestamp, and the full error response body.Symptom: You set stream: true but receive a single non-streamed response — or no response at all.
Causes:
stream flag and return a regular response.Fixes:
response.iter_lines() in Python requests, or the streaming fetch body reader in JavaScript). See Basic chat completions — Streamed responses.Symptom: The model returns content you didn’t expect — wrong format, wrong language, hallucinations, or refusals.
Fixes:
request_id. Send all three to support@assemblyai.com — quality issues are difficult to diagnose without the exact prompt.If you’ve worked through the steps above and still need help, email support@assemblyai.com with:
request_id from the failing response (or several, for intermittent issues)model parameter used