API Reference

Errors

All API errors use a consistent envelope format.

Error envelope

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Model not found or has no published version"
  }
}
FieldTypeDescription
codestringMachine-readable error code
messagestringHuman-readable description

HTTP status codes

StatusWhen it occurs
400 Bad RequestInvalid request body or parameters
401 UnauthorizedMissing, invalid, or revoked API key
404 Not FoundResource doesn't exist, isn't published, or isn't accessible with your key
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorUnexpected server error

Error codes

CodeStatusDescription
UNAUTHORIZED401API key missing or invalid
RATE_LIMITED429Rate limit exceeded
NOT_FOUND404Resource not found
MODEL_NOT_PUBLISHED404Model exists but has no published version
INVALID_FORMAT400Unsupported export format
INTERNAL_ERROR500Unexpected server error

404 vs 401

The API returns 404 (not 403) when a resource exists but the requesting API key doesn't have access to it. This prevents information leakage about the existence of private models.

Retrying errors

  • 401 — Check your API key; no retry will help
  • 404 — Verify the model ID and that the model is published
  • 429 — Wait until X-RateLimit-Reset before retrying
  • 500 — Retry with exponential back-off; if persistent, contact support