API reference
Before you go live
Use this checklist before production traffic. It connects key security, retries, asynchronous task durability, observability, and billing into one release gate.
#Production checklist
Security
- Keep API keys on trusted servers; never ship a permanent key in a browser or mobile binary.
- Use one scoped key per project and configure model, IP, RPM, RPD, and quota limits.
- Rotate keys without changing model integration code.
Reliability
- Set connect and response timeouts for every request.
- Honor Retry-After and use exponential backoff with jitter.
- Use Idempotency-Key for billable async submissions and persist task_id.
Observability
- Log request ID, model, endpoint, latency, HTTP status, and task_id.
- Keep prompt content out of logs unless debugging is explicitly enabled.
- Link customer-visible failures to the matching request-log row.
Cost control
- Read prices and supported options from live model metadata.
- Set project quota ceilings and alert before the wallet is exhausted.
- Reconcile against final six-decimal consumption in Request logs.
#Release gate
- 1
Test the minimum request
Run the exact model and endpoint in Workbench, then copy the generated request.
- 2
Test failure paths
Verify 401, 402, 429, timeout, invalid media, and terminal task failure handling.
- 3
Verify billing
Match a successful request to its six-decimal consumption and request ID.
- 4
Enable monitoring
Alert on error rate, latency, stuck tasks, webhook failures, and low balance.
#Operational shortcuts
Still stuck?
Send us the request ID or the error message and we will look into it.