Error fields
Use the HTTP status and
error.type in program logic. Messages can be improved or localized by the service.
Status codes
Invalid request examples
Common causes of400 include:
- Missing
model,input, orinstruction. - Sending both
choicesandcatalog. - Sending neither
choicesnorcatalog. - Providing fewer than two choices, more than 300 choices, or duplicate choices.
- Sending an empty string where the schema requires a non-empty string.
Authentication errors
Catalog creation, reads, and deletion require a bearer key in the current contract. When a key is missing or invalid, handle401 as a configuration error rather than retrying the same request.
Resource not found
GET /v1/models/{model} returns 404 when the model is not available. Catalog reads and deletes return 404 when the catalog does not exist or is not available to the authenticated account.
Debugging a failed request
- Save the HTTP status and
error.code. - Capture
X-Request-IDif the response includes it. - Record the operation and model without logging secrets.
- For
400or401, fix the request or configuration. - For
429or503, apply the retry policy from production checklist.