Base URL
All endpoint paths documented below begin with /v1.
Authentication
Send an API key as a Bearer token on every request:
Send keys only over HTTPS and only from trusted server-side code. Do not expose them in a browser bundle, mobile app package, screenshot, log, or public repository.
List models
Returns model IDs currently available through the API.
Example response:
Create a chat completion
Sends conversation messages to a model and returns an assistant response.
Request body
Message object
Minimal request
Example response
Response fields
Streaming
Set stream to true to receive incremental server-sent events:
Use an SDK that parses the event stream unless you specifically need to implement SSE parsing. See Code examples .
HTTP status codes
Example error body:
Do not depend on an error message’s exact wording. Branch on the HTTP status and a stable error code when one is available.
Error reference Diagnose each status and choose whether to retry.
Limits and pricing Review service limits before production use.