Skip to content
Get API key API key

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.

During Phase 1 of the API transition the host returns the Legacy API format. The codes and responses below are what it returns today.

CodeNameDescriptionResolution
400Bad RequestInvalid request format or parametersCheck your request body and parameters
401UnauthorizedInvalid API keyCheck the key in your Authorization: Bearer header
403ForbiddenMissing API key, or the key has no access to this resourceSend your key in the Authorization: Bearer header; if it is there, check your plan or contact support
404Not FoundUnknown path, or a model name that does not exist on this hostCheck the URL and the model name
405Method Not AllowedThe path exists, but not with this methodUse the method listed in API endpoints
429Too Many RequestsRate limit or budget exceededFor a rate limit, wait and retry with exponential backoff; for a budget, check your plan
500Internal Server ErrorServer-side error, or the model provider could not be reached or did not answer in timeRetry after a brief delay
503Service UnavailableModel is temporarily unavailableCheck 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.

Errors come back as a detail string. For an unknown model, it names the model and lists the models your key can use:

JSON
{
"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:

JSON
{
"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.

The OpenAI SDKs already retry a 429 twice, with backoff, and follow a Retry-After header when one is sent. For service-level rate limits there is no Retry-After header. For more retries, wrap the call in your own exponential backoff:

Python
import time
from 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.

  • Verify the model name matches exactly (case-sensitive)
  • Use the List models API to check available models; the 404 body lists them too
  • If the name is right and you get 403, your plan doesn’t include the model
  • An invalid key returns 401, a request without a key 403
  • Ensure the key is correctly set in your environment
  • Check that the key hasn’t expired
  • Visit the API Key Portal to manage keys
  • Reduce the input length or set a lower max_tokens
  • Check the model’s meta_data.max_sequence_length in the List models API, or its context window in the catalog