Quickstart
Zyloo speaks the OpenAI API verbatim. If your code talks to api.openai.com, redirect it at our base URL and you're done.
Agentic CLIs — Claude Code, opencode, and the like — point at https://api.zyloo.io. OpenAI-style clients and editors such as Cursor use https://api.zyloo.io/v1.
# 1. Install the official SDK (any language)
npm install openai
# 2. Get your key from https://zyloo.io/dashboard
export ZYLOO_KEY=sk-zy-...
# 3. Make your first call
curl https://api.zyloo.io/v1/chat/completions \
-H "Authorization: Bearer $ZYLOO_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zyloo/claude-opus-4-7",
"messages": [{"role": "user", "content": "Hello"}]
}'Using an agentic coding CLI? Set its base URL to https://api.zyloo.io and your Zyloo key, then run as usual.
# Claude Code, opencode, and other agentic CLIs
export ANTHROPIC_BASE_URL=https://api.zyloo.io
export ANTHROPIC_API_KEY=$ZYLOO_KEY
# Cursor and other OpenAI-compatible editors
# Base URL: https://api.zyloo.io/v1
# API key: $ZYLOO_KEYThe big five coding CLIs
Every popular terminal agent speaks the OpenAI or Anthropic wire format, so they all run on a Zyloo key — copy the block for your tool and swap in any model from the price index.
Anthropic's terminal agent. Point its Anthropic-format variables at the gateway.
npm install -g @anthropic-ai/claude-code
export ANTHROPIC_BASE_URL=https://api.zyloo.io
export ANTHROPIC_API_KEY=$ZYLOO_KEY
export ANTHROPIC_MODEL=zyloo/claude-opus-4-7-thinking
claudeOpenAI's open-source CLI. Register Zyloo as a provider in config.toml.
npm install -g @openai/codex
export ZYLOO_KEY=sk-zy-...# ~/.codex/config.toml
model = "zyloo/gpt-5.5"
model_provider = "zyloo"
[model_providers.zyloo]
name = "Zyloo"
base_url = "https://api.zyloo.io/v1"
env_key = "ZYLOO_KEY"
wire_api = "chat"The model-agnostic open-source favourite. Add Zyloo as a custom provider in opencode.json.
npm install -g opencode-ai
export ZYLOO_KEY=sk-zy-...// opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"zyloo": {
"npm": "@ai-sdk/openai-compatible",
"name": "Zyloo",
"options": {
"baseURL": "https://api.zyloo.io/v1",
"apiKey": "{env:ZYLOO_KEY}"
},
"models": {
"zyloo/claude-opus-4-7": {},
"zyloo/gpt-5.5": {}
}
}
}
}The git-native pair programmer. Uses the standard OpenAI-compatible variables.
python -m pip install aider-install && aider-install
export OPENAI_API_BASE=https://api.zyloo.io/v1
export OPENAI_API_KEY=$ZYLOO_KEY
aider --model openai/zyloo/claude-opus-4-7Alibaba's coding agent. Reads OPENAI_* variables — nothing else to configure.
npm install -g @qwen-code/qwen-code
export OPENAI_BASE_URL=https://api.zyloo.io/v1
export OPENAI_API_KEY=$ZYLOO_KEY
export OPENAI_MODEL=zyloo/deepseek-v4-pro
qwenAuthentication
Every request must include a bearer token in the Authorization header. Keys are scoped per project and can be revoked instantly from the dashboard.
Authorization: Bearer sk-zy-9f3a0e5b...For local development we recommend storing the key in a .env file and loading it through your runtime — never commit keys to source control.
Models
Reference any model by its canonical Zyloo id. Every id is namespaced under zyloo/... so it's unambiguous across providers. The full list of 59 models lives on the Models page.
# A few examples — see /dashboard/models for the full list
zyloo/claude-opus-4-7-thinking
zyloo/claude-opus-4-7
zyloo/gpt-5.5
zyloo/gemini-3.5-flash
zyloo/deepseek-v4-pro
zyloo/grok-4.3curl https://api.zyloo.io/v1/models \
-H "Authorization: Bearer $ZYLOO_KEY"Models with extended reasoning end in -thinking — for example zyloo/claude-opus-4-7-thinking or zyloo/gpt-5.5-xhigh.
Chat completions
The same JSON shape as OpenAI's /v1/chat/completions. Tools, JSON mode, vision and structured outputs are supported on every compatible model.
import OpenAI from "openai";
const zyloo = new OpenAI({
apiKey: process.env.ZYLOO_KEY,
baseURL: "https://api.zyloo.io/v1",
});
const res = await zyloo.chat.completions.create({
model: "zyloo/gemini-3.5-flash",
messages: [
{ role: "system", content: "You are concise." },
{ role: "user", content: "Summarize this PR..." },
],
temperature: 0.2,
max_tokens: 512,
});
console.log(res.choices[0].message.content);Image generation
Image models generate pictures from a text prompt at /v1/images/generations — the same request and response shape as OpenAI's Images API. Image models are billed per image, not per token, and appear on the Models page with a per-image price.
const image = await zyloo.images.generate({
model: "zyloo/your-image-model", // any model marked "Image" on /models
prompt: "A watercolor lighthouse at dawn",
n: 1, // 1–4 images per request
size: "1024x1024",
});
console.log(image.data[0].url ?? image.data[0].b64_json);curl https://api.zyloo.io/v1/images/generations \
-H "Authorization: Bearer $ZYLOO_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zyloo/your-image-model",
"prompt": "A watercolor lighthouse at dawn",
"n": 1
}'- Each request is charged price-per-image × number of images delivered. `n` selects how many images to generate (1–4, default 1).
- You are only charged for images actually delivered: if the provider fails, times out, or returns an error, the hold is released back to your balance automatically.
Models flagged as supporting edits also accept POST /v1/images/edits with a multipart form body (source image + prompt) at the same per-image price. Models without the flag return a 400 on that endpoint.
curl https://api.zyloo.io/v1/images/edits \
-H "Authorization: Bearer $ZYLOO_KEY" \
-F "model=zyloo/your-image-model" \
-F "image=@photo.png" \
-F "prompt=Add a red scarf" \
-F "n=1"Streaming
Pass stream: true to receive Server-Sent Events with the same delta format as OpenAI.
const stream = await zyloo.chat.completions.create({
model: "zyloo/claude-opus-4-7",
stream: true,
messages: [{ role: "user", content: "Tell me a story" }],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Errors
Zyloo returns OpenAI-compatible error objects. Common codes:
| Code | Meaning | Action |
|---|---|---|
| 401 | Invalid key | Rotate from dashboard |
| 402 | Insufficient credit | Top up wallet |
| 429 | Rate limited | Backoff, we route to a sibling provider |
| 5xx | Upstream failure | Auto-retry with idempotency-key |