ZEKA API

The chat models of ZEKA Studio for your own apps and services. The API follows the OpenAI Chat Completions format, so the usual OpenAI libraries work by changing only the address and the key.

Start

Base URLhttps://api.zekastudio.site/v1

Authsend your key in the header Authorization: Bearer zk-…. Keep the key secret: never put it in a web page or an app that others can open.

Your key is issued by ZEKA and linked to your ZEKA account. Usage is paid from the credits of that account.

Chat

curl

curl https://api.zekastudio.site/v1/chat/completions \
  -H "Authorization: Bearer $ZEKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-argon",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Write a two-line product caption for a linen shirt."}
    ]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.zekastudio.site/v1", api_key="zk-...")
answer = client.chat.completions.create(
    model="gemini-4-argon",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(answer.choices[0].message.content)

JavaScript

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.zekastudio.site/v1", apiKey: process.env.ZEKA_API_KEY });
const answer = await client.chat.completions.create({
  model: "gemini-4-argon",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(answer.choices[0].message.content);

Parameters

FieldNotes
modelRequired. An id from GET /v1/models.
messagesRequired. Roles: system, developer, user, assistant, tool. Content is text or a list of text / image_url parts.
max_tokens / max_completion_tokensLongest answer, reasoning included. Default 16384 when not sent; up to 128000 (or the model's own limit).
stream, stream_options.include_usageServer-sent events; with include_usage the last event carries the token usage.
temperature, top_p, stop, seed, presence_penalty, frequency_penalty, logit_biasAs in the OpenAI format, when the model supports them.
tools, tool_choice, parallel_tool_calls, response_format, reasoning_effortAs in the OpenAI format, when the model supports them.
nOnly 1.

Streaming

stream = client.chat.completions.create(
    model="gemini-4-argon",
    messages=[{"role": "user", "content": "Tell me a short story."}],
    stream=True,
    stream_options={"include_usage": True},
)
for event in stream:
    if event.choices and event.choices[0].delta.content:
        print(event.choices[0].delta.content, end="", flush=True)

Images in the question

Models marked "input": ["text", "image"] in /v1/models read images, as a URL or a data: URL. One request may be up to 20 MB.

{"role": "user", "content": [
  {"type": "text", "text": "Describe this product photo for an online shop."},
  {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQ..."}}
]}

Tools (function calling)

Send tools in the OpenAI format; the answer returns tool_calls. Run the function yourself and send its result back as a tool message.

Models and balance

curl https://api.zekastudio.site/v1/models  -H "Authorization: Bearer $ZEKA_API_KEY"
curl https://api.zekastudio.site/v1/balance -H "Authorization: Bearer $ZEKA_API_KEY"

/v1/models lists only the models your key may use. /v1/balance shows the credits available in your account.

Billing

Errors

Errors use the OpenAI shape: {"error": {"message", "type", "code"}}.

HTTPcodeMeaning
400invalid_request, invalid_json, model_requiredThe request is not valid. The message says what to fix.
401invalid_api_key, api_key_disabledMissing, wrong or switched-off key.
402insufficient_creditsNot enough credits. Top up.
403model_not_allowed, account_inactiveThe key or account may not use this model.
404model_not_foundUnknown model id.
413request_too_largeThe request is larger than 20 MB.
429rate_limited, too_many_at_once, daily_cap_reached, spending_limit, model_busySlow down, wait or raise the limit with ZEKA.
502 / 503 / 504unavailable, bad_answer, timeout, maintenanceTemporary. Retry after a short wait.

© ZEKA Studio · zekastudio.site