Get started

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/v1

Authentication

Create a key in YZ Console under API Keys, then send it as a Bearer token in the Authorization header.

Authorization: Bearer $YZ_API_KEY

Treat 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.

YZ API endpoints
MethodPathFormat
POST/v1/alpha/searchopenai-alpha-search
POST/v1/chat/completionsOpenAI Chat Completions
POST/v1/messagesAnthropic Messages
POST/v1/responsesOpenAI Responses
POST/v1/responses/compactOpenAI Responses (compact)
POST/v1beta/models/{model}:generateContentGemini generateContent
GET/v1/modelsList the models your key can use

Models

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.

YZ API error statuses, their meaning and the fix
StatusWhat happenedWhat to do
400The request body isn’t valid for this endpoint.Check the JSON and the required fields, such as model and messages.
401The API key is missing, wrong, disabled or expired.Check the Authorization header, or create a new key in the console.
403Your 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.
429Too many requests in a short time.Wait a moment and retry, with backoff.
503No route is available for this model right now.Check the model name against the catalogue, or try another model.
500 / 502The 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.

Model pricesHow billing works