Error codes
When an API request fails, the response includes an HTTP status code and an error message. Here are the common errors and how to resolve them.
This page describes the API at https://llm-server.llmhub.t-systems.net/v2. How codes and the error format differ during the API transition: see API transition: error handling.
HTTP status codes
Section titled “HTTP status codes”During Phase 1 of the API transition the host returns the Legacy API format. The codes and responses below are what it returns today.
| Code | Name | Description | Resolution |
|---|---|---|---|
400 | Bad Request | Invalid request format or parameters | Check your request body and parameters |
401 | Unauthorized | Invalid API key | Check the key in your Authorization: Bearer header |
403 | Forbidden | Missing API key, or the key has no access to this resource | Send your key in the Authorization: Bearer header; if it is there, check your plan or contact support |
404 | Not Found | Unknown path, or a model name that does not exist on this host | Check the URL and the model name |
405 | Method Not Allowed | The path exists, but not with this method | Use the method listed in API endpoints |
429 | Too Many Requests | Rate limit or budget exceeded | For a rate limit, wait and retry with exponential backoff; for a budget, check your plan |
500 | Internal Server Error | Server-side error, or the model provider could not be reached or did not answer in time | Retry after a brief delay |
503 | Service Unavailable | Model is temporarily unavailable | Check Model Status and retry |
The New API answers some of these cases with other codes (401 for a missing key, 400 for an unknown model, 402 for a budget, 502 and 504 for the provider). See API transition: error handling.
Error response format
Section titled “Error response format”Errors come back as a detail string. For an unknown model, it names the model and lists the models your key can use:
{ "detail": "The model my-model does not exist or discontinued or you might using wrong api. Available models are: [...]" }When the model provider rejects a request, detail holds the provider’s status and its error object as text:
{ "detail": "Error: 400 - Bad Request - {\"error\": {\"message\": \"Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. \" , \"type\": \"invalid_request_error \", \"param\": \"max_tokens \", \"code\": \"unsupported_parameter \"}}" }Use the HTTP status as the primary signal. Read detail for the reason, but do not parse it: its text is not a stable format.
Handling rate limits (429)
Section titled “Handling rate limits (429)”The OpenAI SDKs already retry a 429 twice, with backoff, and follow a Retry- header when one is sent. For service-level rate limits there is no Retry- header. For more retries, wrap the call in your own exponential backoff:
import timefrom openai import OpenAI, RateLimitError
client = OpenAI()
def call_with_retry (messages, max_retries =3 ): for attempt in range(max_retries + 1): try: return client.chat.completions.create( model="gpt-oss-120b" , messages=messages, ) except RateLimitError: if attempt == max_retries: raise wait = 2 ** attempt print( f"Rate limited. Retrying in {wait}s..." ) time.sleep(wait) A 429 can also mean the budget is exceeded. That is not a rate limit, and retrying does not help: check the error message, then your plan’s budget.
Common issues
Section titled “Common issues”Model not found (404)
Section titled “Model not found (404)”- Verify the model name matches exactly (case-sensitive)
- Use the List models API to check available models; the
404body lists them too - If the name is right and you get
403, your plan doesn’t include the model
Invalid or missing API key (401, 403)
Section titled “Invalid or missing API key (401, 403)”- An invalid key returns
401, a request without a key403 - Ensure the key is correctly set in your environment
- Check that the key hasn’t expired
- Visit the API Key Portal to manage keys
Context length exceeded (400)
Section titled “Context length exceeded (400)”- Reduce the input length or set a lower
max_tokens - Check the model’s
meta_in the List models API, or its context window in the catalogdata. max_ sequence_ length
Next steps
Section titled “Next steps”- Reliability and retries for 429, 500, and 503.
- Rate limits for RPM and TPM.
- Authentication for 401 and 403.
- API transition for the codes of the New API.