For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • API Guides
    • Overview
    • Streaming
    • Embeddings
    • Limits
    • Authentication
    • Parameters
    • Errors and Debugging
      • Overview
      • Basic Usage
      • Reasoning
      • Tool Calling
      • Web Search
      • Error Handling
  • API Reference
LogoLogo
ModelsChatRankingsDocs
On this page
  • Error Response Format
  • Error Codes
API GuidesResponses API

Error Handling

Understanding and handling errors in the Responses API Beta
Was this page helpful?
Previous

Create a response

Next
Built with
Beta API

This API is in beta stage and may have breaking changes. Use with caution in production environments.

Stateless Only

This API is stateless - each request is independent and no conversation state is persisted between requests. You must include the full conversation history in each request.

The Responses API Beta returns structured error responses that follow a consistent format.

Error Response Format

All errors follow this structure:

1{
2 "error": {
3 "code": "invalid_prompt",
4 "message": "Detailed error description"
5 },
6 "metadata": null
7}

Error Codes

The API uses the following error codes:

CodeDescriptionEquivalent HTTP Status
invalid_promptRequest validation failed400
rate_limit_exceededToo many requests429
server_errorInternal server error500+