pinstripes.

Errors

All errors use the OpenAI error format. The HTTP status code and the code field in the body carry the same value.

Error shape

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": 401
  }
}

Error codes

StatusTypeMeaning
400invalid_request_errorMalformed request body — missing required fields or unparseable JSON.
401authentication_errorMissing, expired, or invalid API key or session token.
402payment_requiredAccount balance exhausted or subscription inactive.
422invalid_request_errorValid JSON but invalid parameter values, e.g. unknown model ID.
429rate_limit_errorExceeded the per-key or fleet RPM limit. Check the Retry-After header.
500server_errorInternal error on the inference backend. Transient — safe to retry.
503service_unavailableNo healthy inference workers available. Retry with exponential backoff.

What a 401 looks like

curl -X POST https://api.pinstripes.io/v1/chat/completions \
  -H "Authorization: Bearer bad-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"ps/deepseek-v4-flash","messages":[{"role":"user","content":"hi"}]}'

# HTTP 401
{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": 401
  }
}

Retries

503 errors mean no workers are available — retry with exponential backoff starting at 1 second. 429 errors include a Retry-After header (seconds) indicating when the rate limit window resets. 500 errors are safe to retry immediately once, then with backoff.