@@ -2188,6 +2188,38 @@ components:
21882188 required:
21892189 - type
21902190 type: object
2191+ ApiErrorType:
2192+ description: Canonical OpenRouter error type, stable across all API formats
2193+ enum:
2194+ - context_length_exceeded
2195+ - max_tokens_exceeded
2196+ - token_limit_exceeded
2197+ - string_too_long
2198+ - authentication
2199+ - permission_denied
2200+ - payment_required
2201+ - rate_limit_exceeded
2202+ - provider_overloaded
2203+ - provider_unavailable
2204+ - invalid_request
2205+ - invalid_prompt
2206+ - not_found
2207+ - precondition_failed
2208+ - payload_too_large
2209+ - unprocessable
2210+ - content_policy_violation
2211+ - refusal
2212+ - invalid_image
2213+ - image_too_large
2214+ - image_too_small
2215+ - unsupported_image_format
2216+ - image_not_found
2217+ - image_download_failed
2218+ - server
2219+ - timeout
2220+ - unmapped
2221+ example: rate_limit_exceeded
2222+ type: string
21912223 ApplyPatchCallItem:
21922224 description: >-
21932225 A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an
@@ -5076,6 +5108,8 @@ components:
50765108 example:
50775109 code: 429
50785110 message: Rate limit exceeded
5111+ metadata:
5112+ error_type: rate_limit_exceeded
50795113 properties:
50805114 code:
50815115 description: Error code
@@ -5086,6 +5120,17 @@ components:
50865120 description: Error message
50875121 example: Rate limit exceeded
50885122 type: string
5123+ metadata:
5124+ description: Structured error metadata
5125+ properties:
5126+ error_type:
5127+ $ref: '#/components/schemas/ApiErrorType'
5128+ provider_code:
5129+ description: Upstream provider-specific error code, when available
5130+ type: string
5131+ required:
5132+ - error_type
5133+ type: object
50895134 required:
50905135 - message
50915136 - code
@@ -11472,9 +11517,12 @@ components:
1147211517 type: object
1147311518 MessagesErrorDetail:
1147411519 example:
11520+ error_type: invalid_request
1147511521 message: Invalid request parameters
1147611522 type: invalid_request_error
1147711523 properties:
11524+ error_type:
11525+ $ref: '#/components/schemas/ApiErrorType'
1147811526 message:
1147911527 type: string
1148011528 type:
@@ -11487,12 +11535,15 @@ components:
1148711535 description: Error event in the stream
1148811536 example:
1148911537 error:
11538+ error_type: provider_overloaded
1149011539 message: Overloaded
1149111540 type: overloaded_error
1149211541 type: error
1149311542 properties:
1149411543 error:
1149511544 properties:
11545+ error_type:
11546+ $ref: '#/components/schemas/ApiErrorType'
1149611547 message:
1149711548 type: string
1149811549 type:
@@ -11501,6 +11552,8 @@ components:
1150111552 - type
1150211553 - message
1150311554 type: object
11555+ openrouter_metadata:
11556+ $ref: '#/components/schemas/OpenRouterMetadata'
1150411557 type:
1150511558 enum:
1150611559 - error
@@ -15574,6 +15627,8 @@ components:
1557415627 allOf:
1557515628 - $ref: '#/components/schemas/BaseResponsesResult'
1557615629 - properties:
15630+ error_type:
15631+ $ref: '#/components/schemas/ApiErrorType'
1557715632 openrouter_metadata:
1557815633 $ref: '#/components/schemas/OpenRouterMetadata'
1557915634 output:
0 commit comments