What you need to call YZ API: the base URL, your key, the endpoints, errors and billing. The request format is OpenAI-compatible.
Base URL
Send every request to this address over HTTPS. One key works for every endpoint.
https://api.yzware.com/v1Authentication
Create a key in YZ Console under API Keys, then send it as a Bearer token in the Authorization header.
Authorization: Bearer $YZ_API_KEYTreat a key like a password: keep it on your server, never in browser code, and disable it in the console if it leaks. The examples read it from the YZ_API_KEY environment variable.
Your first request
A chat completion in curl, Python or Node.js. Change the model name to any model in the catalogue.
curl https://api.yzware.com/v1/chat/completions \
-H "Authorization: Bearer $YZ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "example-text-model",
"messages": [
{ "role": "user", "content": "Summarise this invoice in one line." }
]
}'
OpenAI-compatible request format. The model name is an example; pick one from the catalogue.
Runs locally in your browser. Nothing is sent.
Endpoints
The endpoints that listed models accept right now. Each model’s page shows the ones it supports.
| Method | Path | Format |
|---|---|---|
| POST | /v1/alpha/search | openai-alpha-search |
| POST | /v1/chat/completions | OpenAI Chat Completions |
| POST | /v1/messages | Anthropic Messages |
| POST | /v1/responses | OpenAI Responses |
| POST | /v1/responses/compact | OpenAI Responses (compact) |
| POST | /v1beta/models/{model}:generateContent | Gemini generateContent |
| GET | /v1/models | List the models your key can use |
Streaming
Add "stream": true to the request body to receive the answer as server-sent events, one chunk at a time. The stream ends with data: [DONE].
A streamed call is recorded and charged like any other once it finishes.
Errors
Errors come back in the OpenAI shape: an error object with a message and a code. The HTTP status tells you what to do next.
| Status | What happened | What to do |
|---|---|---|
| 400 | The request body isn’t valid for this endpoint. | Check the JSON and the required fields, such as model and messages. |
| 401 | The API key is missing, wrong, disabled or expired. | Check the Authorization header, or create a new key in the console. |
| 403 | Your balance doesn’t cover the request, or the key isn’t allowed to use this model. | Top up, or check the key’s model limits in the console. |
| 429 | Too many requests in a short time. | Wait a moment and retry, with backoff. |
| 503 | No route is available for this model right now. | Check the model name against the catalogue, or try another model. |
| 500 / 502 | The model provider returned an error. | Retry. If it keeps happening, contact us with the request time. |
Usage and billing
Each call is charged at its model’s listed price for the input and output tokens it used. The charge appears on that call’s usage record in the console.
Prices are in US dollars per million tokens. A call keeps the price that applied when it was made.