API Access
Get started
- Create an API key in the customer portal.
- Inject it into a server environment as
API_KEY. - Call
/v1/modelsto select a currently available model. - Follow the quickstart to send a request.
Authentication safety
The data API uses Authorization: Bearer $API_KEY. Never put a Direct API key in a browser, mobile app, Git repository, image, log, or error report.
Migration and compatibility
See migrating from the OpenAI SDK or migrating from the Anthropic SDK. Protocol compatibility does not guarantee identical model behavior, so validate outputs and error handling after migration.
Timeouts, limits, and retries
Configure connection, first-byte, and whole-request timeouts. Apply backoff after 429 responses. Use an explicit idempotency policy when retrying POST requests.
For diagnosis, retain the HTTP status, safe error code, and X-Request-Id. Do not log prompts or responses.