~/docs|live

API Documentation

OpenAI-compatible API gateway. Base URL: https://api.zlkpro.tech
Drop-in replacement — point any OpenAI SDK here and start building.

Quickstart

The API is fully OpenAI-compatible. Point any OpenAI SDK at https://api.zlkpro.tech and use your ZLKPro API key.

curl.sh
curl https://api.zlkpro.tech/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "zlkcombo",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
quickstart.py
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zlkpro.tech/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="zlkcombo",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
quickstart.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.zlkpro.tech/v1",
  apiKey: "YOUR_API_KEY",
});

const response = await client.chat.completions.create({
  model: "zlkcombo",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(response.choices[0].message.content);

Authentication

All requests require a Bearer token in the Authorization header. Generate keys from your dashboard or via the Telegram bot.

auth.sh
# Header format
Authorization: Bearer sk-zlk-xxxxxxxxxxxxxxxx

Keys are SHA256-hashed at rest. Never share your key — if compromised, rotate it immediately from the dashboard.

Available Endpoints

MethodPathDescription
POST/v1/chat/completionsChat completions (OpenAI format)
POST/v1/completionsText completions (legacy)
POST/v1/embeddingsText embeddings
GET/v1/modelsList available models

Available Models

zlkpro@modelsboot
> establishing secure channel ░░░░░░░░░░░░░░░░ --
> querying model registry ░░░░░░░░░░░░░░░░ --
> syncing usage telemetry ░░░░░░░░░░░░░░░░ --
> rendering interface ░░░░░░░░░░░░░░░░ --

Error Codes

StatusCodeDescription
400bad_requestMalformed request body or parameters
401unauthorizedMissing or invalid API key
402payment_requiredInsufficient balance or expired subscription
403forbiddenKey blocked or model not permitted
404not_foundModel not found
429rate_limitedRate limit exceeded — slow down or retry
500server_errorInternal error — retry with backoff
503service_unavailableUpstream provider temporarily unavailable

Rate Limits

Rate limits are applied per API key and scale with your plan. All responses include rate-limit headers.

PlanRequests / min
Loading rate limits…

Headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

On 429, respect the Retry-After header before retrying.

Streaming

All chat completion endpoints support "stream": true. Responses use Server-Sent Events (SSE) — each chunk is a data: {...} line terminated by a blank line. The stream ends with data: [DONE].

stream.sh
# -N disables buffering so you see chunks in real-time
curl -N https://api.zlkpro.tech/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "zlkcombo",
    "stream": true,
    "messages": [
      {"role": "user", "content": "Count to 5 slowly."}
    ]
  }'
stream.py
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zlkpro.tech/v1",
    api_key="YOUR_API_KEY",
)

# streaming=True returns an iterator of chunks
stream = client.chat.completions.create(
    model="zlkcombo",
    stream=True,
    messages=[{"role": "user", "content": "Count to 5 slowly."}],
)

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

print()  # newline
stream.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.zlkpro.tech/v1",
  apiKey: "YOUR_API_KEY",
});

const stream = await client.chat.completions.create({
  model: "zlkcombo",
  stream: true,
  messages: [{ role: "user", content: "Count to 5 slowly." }],
});

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

Tip: When streaming, the usage field is included in the final chunk (with stream_options: { include_usage: true }).

Webhooks & Bot

Manage your account and API keys directly from Telegram. The bot @zlkprobot runs in webhook mode and responds to the following commands:

CommandDescription
/startLink your Telegram account to ZLKPro and get started
/keyGenerate a new API key or list your existing keys
/usageShow current billing cycle usage, spend, and token counts
/modelsList all available model IDs and their families

The bot webhook is served at /api/bot/webhook — no long-polling, no extra infrastructure needed.

SDK Compatibility

ZLKPro implements the OpenAI API spec. Any SDK that lets you override the base_url works out of the box.

SDKLanguageCompatibilityNotes
openaiPython / NodeFullSet base_url — zero code changes
langchain-openaiPython / NodeFullChatOpenAI(openai_api_base="...")
llama-indexPythonFullset api_base on LLM or Settings
autogenPythonFullSet base_url in config_list
curl / httpieCLIFullRaw HTTP — no SDK needed

zlkpro docs · last updated 2026-07