Skip to content

API Transition: Error Handling

The New API (https://llm-server.ai.t-systems.net/v1) introduces structured error responses, making it easier for applications to identify errors and handle them consistently. Standard HTTP status codes continue to indicate request outcomes, while certain error scenarios now have more specific status codes. For the general error reference, see Error Codes.

ScenarioLegacy APINew API
Missing API key403401
Invalid API key401401
Blocked or deactivated key401403
Model not found404400 for model resolution errors
Model access denied404403
Rate limit exceeded429429
Budget exceeded429402
Invalid request400, sometimes plain text400, structured JSON
Provider connection failure500502
Provider timeout500504

The Legacy API typically returns provider error information as a string inside detail. The New API returns structured error information.

{
"detail": "Error: 400 - Bad Request - {\"error\":{\"message\":\"Invalid request parameter\",\"type\":\"invalid_request_error\"}}"
}

Structured error fields allow applications to access error details without parsing an embedded provider error message.

For standard HTTP error handling: Applications can continue relying on HTTP response status codes.

For custom error handling: Review code that depends on specific status codes, error-message text, or the Legacy API’s detail field.

Use the actual HTTP response status as the primary indicator, and treat error fields such as type, code, and param as optional.

The New API distinguishes between provider rate limits, service-level rate limits, and budget restrictions.

ScenarioHTTP statusRetry information
Provider rate limit429Provider-supplied retry information may be available
Service-level rate limit429No Retry-After header; reset information may appear in the error message
Budget exceeded402No Retry-After header; budget information may appear in the error message

When a provider supplies a Retry-After header and it is forwarded in the response, applications should respect it. For service-level rate limits, implement your own backoff strategy; see Rate Limits.

Budget-related errors should be handled separately and should not trigger automatic retries.

Validate the response Content-Type before attempting to parse the response body. Some unsupported API routes or methods may return HTML rather than JSON.

A successful HTTP status alone does not guarantee that the response contains the expected API structure.

When reporting an issue, include the request timestamp, endpoint, HTTP status, and any available request or trace identifier. This helps support investigate requests more efficiently.

For questions or migration support, contact AI@t-systems.com.