AI API · OpenAI compatible

Connect the ZaitXCode AI API

One endpoint, one key, and every model behind it: 29 free providers plus OpenRouter, with your plan's limits applied automatically. The API speaks the OpenAI format, so the official SDKs and every editor that speaks OpenAI work with it unchanged.

1 · Get your key

Sign in on zaitxcode.com, open your account page and create a key in the API Keys section. The key is an AI API key: it can only reach the AI endpoints (chat, models and usage) — never your account, the admin API or the billing. Copy it when it is shown: it is never displayed again.

Open the account page

2 · The base URL

Every request goes to this base URL with the key in the Authorization header.

https://api.zaitxcode.com/v1
POST/v1/chat/completionsChat completions (streaming and non-streaming)
GET/v1/modelsThe models your plan may use
GET/v1/usageYour usage for the current period
GET/v1/planYour plan, its limits and the included tokens

3 · Call it

JavaScript (the OpenAI SDK)



const client = new OpenAI({
  baseURL: "https://api.zaitxcode.com/v1",
  apiKey: process.env.ZAITXCODE_API_KEY,
});

const stream = await client.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "Explain the ZaitXCode AI API." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Python



client = OpenAI(
    base_url="https://api.zaitxcode.com/v1",
    api_key=os.environ["ZAITXCODE_API_KEY"],
)

stream = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)

for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")

cURL


  -H "Authorization: Bearer $ZAITXCODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{ "role": "user", "content": "Hello" }]
}'

4 · Use it in your editor

Every editor that speaks the OpenAI API works with the same base URL and key (VS Code with Continue or Cline, JetBrains, Cursor, Zed, …). Set:

Base URL:  https://api.zaitxcode.com/v1
API Key:  sk_gw_…            (the key from your account page)

5 · The plans

One subscription covers the chat on the site and this API — the same plan, the same limits. The free providers are always tried first; a paid model is only reached by the paid plans.

Free

$0

The free models, a small daily allowance

Pro

$9.99 / month

Code, images, a daily video clip

Ultra

$29.99 / month

Deep reasoning, web search, project context

Ultimate

$64.99 / month

The maximum: 4K media, the strongest models

See the plans and subscribe

6 · A few rules

  • Never put the key in the browser of a public app — put it on your server.
  • The key is scoped to the AI API: it cannot reach anything else.
  • The free providers are tried first; the paid ones only for the paid plans.
  • Every plan has a daily request cap and a token budget — /v1/plan shows yours.