Skip to main content
The Infercom API uses standard HTTP response status codes to indicate whether an API request was successful or failed. When a request fails, the API responds with a JSON object containing details about the error.

The error envelope

Every error response uses the same shape. The error detail is nested inside an error object, and the response carries a request_id alongside it.
Example error response
Log request_id on every failed request. It is the field our support team needs to trace a request end to end. Include it in every report you open at support.infercom.ai.
Two responses do not use this envelope. See Responses that do not use the envelope before you write your error handling.

Error categories

Use the following table to understand the various error categories.
If you are experiencing 500 or 503 errors, check the Infercom Status Page for any ongoing incidents or scheduled maintenance before contacting support.

Error code reference

Use the following table to understand and troubleshoot errors programmatically.

Responses that do not use the envelope

Two paths return a flat body where error is a string instead of an object. Both omit request_id. A client that reads error.message gets undefined on these two responses. Handle both shapes. Check whether error is a string before you read error.message.

Malformed image data

Returned by vision requests when the API cannot decode the image. HTTP 400.

A forced tool_choice that the model does not satisfy

Returned by function calling requests when you force a specific function and the model produces no valid call. HTTP 400.
This body adds a field the envelope does not define, error_model_output. It carries the text the model produced instead of the tool call. Note also that error_type holds a sentence here, not a code such as invalid_request_error.

Defensive parsing