Skip to main content
For the full error structure, see API error codes. This page is a quick reference.

4xx client errors

HTTPcodeTroubleshooting
400invalid_request_errorCheck the request body JSON format and required fields
400invalid_modelModel ID spelling or token allowlist
400context_length_exceededShorten the input / switch to a large-context model
400unsupported_modalityThe model doesn’t support image / audio input
400invalid_parameterA field value is out of range (e.g. temperature > 2)
401invalid_api_keyKey doesn’t exist / wrong format / contains a newline
401expired_api_keyToken expired — extend it or create a new one
401disabled_api_keyToken disabled — enable it or create a new one
403insufficient_quotaAccount or token quota exhausted — top up
403model_not_allowedEdit the token to add this model
403ip_not_allowedThe source IP isn’t in the allowlist
404model_not_foundModel retired or misspelled
404resource_not_foundThe task / file doesn’t exist
413request_too_largeThe request body exceeds the 32MB limit
422validation_errorSchema validation failed
429rate_limit_exceededRPM / TPM hit — back off and retry
429concurrent_limit_exceededConcurrency ceiling exceeded
429upstream_rate_limitedUpstream 429 — the client should also back off

5xx server errors

HTTPcodeTroubleshooting
500server_errorInternal gateway error, usually auto-retried. To report, include the Request ID
502bad_gatewayThe upstream returned an invalid response
503upstream_unavailableAll upstream channels are temporarily unavailable — wait or switch models
504upstream_timeoutUpstream timed out — shorten the input or retry

Task-API specific

codeApplies toNotes
task_failedMidjourney / Suno / SoraThe task failed upstream — see failure_reason
task_not_foundAsync tasksThe task ID doesn’t exist or is past its retention period
task_queue_fullAsync tasksThe upstream queue is full — retry later

Errors during streaming

When a streaming 200 response errors midway, it is sent as SSE:
data: {"error":{"message":"...","type":"server_error","code":"upstream_timeout"}}
data: [DONE]
Always check the error field when consuming SSE.

General troubleshooting flow

1

Copy the Request ID

Get the ID from the X-OpenPAI-Request-Id response header.
2

Check the logs

Console → Logs → search for the Request ID to see the model, token usage and error code.
3

Verify the key

curl https://openp.ai/v1/models -H "Authorization: Bearer sk-..." to verify the key works.
4

Keep the details

If you still can’t pin it down, record the Request ID, the time of the error, and reproduction steps for later investigation.