API Quick Start
Create an API key in your account's API Keys page. Send it as a bearer token and choose a model ID returned by GET /v1/models. Model availability depends on your account.
List models
curl https://www.saverouter.cc/v1/models \
-H "Authorization: Bearer <YOUR_API_KEY>"The response contains model IDs in the data array.
Send a chat request
The model and messages fields are required. Use a model ID from the response above; temperature, max_tokens, and stream are optional when supported by the model.
curl https://www.saverouter.cc/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello"}]}'A successful non-streaming response contains choices and usage. Errors use an error object with a type and message. Check HTTP status codes: fix 400/401/403 requests instead of retrying, and use bounded backoff for transient 429/5xx failures.