Skip to Content
Errors422 Unprocessable Entity

422 Unprocessable Entity

The request body was syntactically valid JSON but failed schema or business-logic validation. The errors array lists every validation failure — fix all of them before retrying.

Error shape

{ "error": { "code": "validation_error", "message": "Request body validation failed.", "request_id": "req_01hwz3kj4p5qm8n9v2t6yr", "errors": [ { "field": "daily_limit_usd", "message": "must be greater than 0", "value": -5 }, { "field": "scope", "message": "must be one of: org, team, key", "value": "global" } ] } }

Common causes

Missing required field

{ "errors": [{ "field": "provider", "message": "field is required" }] }

Fix: Add the missing field to your request body. Check the API reference for the full schema.


Invalid model name

{ "errors": [ { "field": "model", "message": "Unknown model 'gpt5'. Did you mean 'gpt-4o'?", "value": "gpt5" } ] }

Fix: Use a valid model name. The gateway passes model names through to the provider unchanged — check the provider’s model list for exact names. Common mistakes:

What you sentWhat you meant
gpt-4gpt-4o or gpt-4-turbo
gpt5gpt-4o (GPT-5 not released)
claude-3claude-opus-4-5 or claude-sonnet-4-5
claude-3-haikuclaude-haiku-4-5

Invalid budget value

{ "errors": [ { "field": "daily_limit_usd", "message": "must be between 0.01 and 10000.0", "value": 0 } ] }

Fix: Set a budget between $0.01 and $10,000. Use null to remove a budget cap entirely.


Invalid scope

{ "errors": [{ "field": "scope", "message": "must be one of: org, team, key" }] }

Fix: Use one of the valid scope values: "org", "team", or "key".


PII scan — malformed request body

{ "error": { "code": "validation_error", "message": "messages[0].content must be a string or array of content parts", "errors": [ { "field": "messages[0].content", "message": "expected string or array, got number" } ] } }

Fix: Ensure messages[].content is either a plain string or an array of content parts:

# Wrong messages=[{"role": "user", "content": 42}] # Correct (string) messages=[{"role": "user", "content": "Hello"}] # Correct (content parts array — for vision) messages=[{ "role": "user", "content": [ {"type": "text", "text": "What is in this image?"}, {"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}} ] }]

Debugging 422s

The errors array is exhaustive — all validation failures for the request are returned at once. Fix every item in the array before retrying; a partial fix will still return 422 for the remaining issues.

# Pretty-print the full error body curl -s -X POST https://api.curate-me.ai/v1/admin/budgets \ -H "X-CM-API-Key: $CM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"daily_limit_usd": -5, "scope": "global"}' | jq '.error.errors'