API Reference

Responses & Errors

Error schema and recommended handling strategies.

Error Schema

{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits to process this video",
    "request_id": "req_123456"
  }
}

Common Error Cases

EndpointHTTPExample MessageAction
/api/upload400Invalid file typeUse supported video MIME
/api/upload400File too largeKeep file <= 500MB
/v1/jobs/{job_id}404Job not foundCheck job id and key ownership
/api/download/{job_id}400Job not completedPoll status until completed
/v1/jobs500Processing failedRetry with backoff

Logging Recommendations

  • Log job_id for every process/status/download call.
  • Log upstream RunPod errors with correlation id.
  • Emit structured logs for retries and final failures.

API Contract Notes

  • All clients should handle non-2xx responses as structured error payloads.
  • Use explicit JSON schema validation for request payloads on your side.
  • Treat output_url as an asynchronous artifact and not an immediate response contract.
  • Persist job lifecycle state transitions for auditing and support.

Integration Verification

CheckHow to Verify
AuthenticationCall endpoint with valid and invalid key, confirm 200 vs 401
Rate limitsBurst test and confirm 429 handling with backoff
IdempotencyRetry same request and verify no duplicate side effects
ObservabilityConfirm request_id/job_id appears in logs and dashboards

Error Classification

ClassExamplesAction
Client Errors (4xx)invalid_request, invalid_api_keyFix payload/config
Capacity/Limitrate_limited, insufficient_creditsRetry/backoff or top-up
Server Errors (5xx)internal_error, timeoutRetry with fallback and alerting