Help & Documentation

AI API gateway

Console

Using the console

  • Registration is invite-only. Ask an existing member for an invite code, then sign up with it.
  • After signing in, create an API key under “API Keys”. The full key is shown only once — copy and store it safely.
  • Use the key as a Bearer token in API requests. You can disable or delete keys at any time.
  • Balance and usage are shown in the console. Top-ups are manual for now — contact the operator.
  • The console supports light/dark theme and Chinese/English. All data is scoped to your own account.

Using the API

API base URL https://api.plekoai.com/v1
Authentication Authorization: Bearer sk-plk-…

Every request must carry the Authorization header with your key.

Models: GET /v1/models lists all available models. “~latest” aliases always resolve to the newest model of a family.

Both streaming (stream: true) and non-streaming responses are supported. Streaming reports usage in the final chunk.

Errors follow the OpenAI error format (JSON with error.message / error.code). HTTP 402 means insufficient balance.

Python example
from openai import OpenAI

client = OpenAI(
    base_url="https://api.plekoai.com/v1",
    api_key="sk-plk-你的密钥",
)

r = client.chat.completions.create(
    model="~openai/gpt-sol-latest",
    messages=[{"role": "user", "content": "你好"}],
)
print(r.choices[0].message.content)
Node.js example
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.plekoai.com/v1",
  apiKey: "sk-plk-你的密钥",
});

const r = await client.chat.completions.create({
  model: "~openai/gpt-sol-latest",
  messages: [{ role: "user", content: "你好" }],
});
console.log(r.choices[0].message.content);
cURL example
curl -X POST https://api.plekoai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-plk-你的密钥" \
  -d '{"model":"~openai/gpt-sol-latest","messages":[{"role":"user","content":"你好"}]}'

Use with opencode

opencode requires a static model list for custom providers. Save the following as your opencode.json, restart opencode, then pick a model with /models.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "plekoai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "PlekoAI",
      "options": {
        "baseURL": "https://api.plekoai.com/v1",
        "apiKey": "sk-plk-你的密钥"
      },
      "models": {
        "~anthropic/claude-sonnet-latest": { "name": "Claude Sonnet (latest)" },
        "~openai/gpt-sol-latest": { "name": "GPT Sol (latest)" },
        "~google/gemini-flash-latest": { "name": "Gemini Flash (latest)" }
      }
    }
  },
  "model": "plekoai/~anthropic/claude-sonnet-latest",
  "small_model": "plekoai/~google/gemini-flash-latest"
}

Change the default model by editing the top-level model field. Any OpenRouter slug or ~latest alias works.

Use with Cursor

In Cursor, open Settings → Models, enter your sk-plk- key as the OpenAI API key and set the Base URL to https://api.plekoai.com/v1.

Then choose any model — the gateway forwards it to the upstream provider.

Other tools & SDKs

Any OpenAI-compatible SDK or client works: set base_url to https://api.plekoai.com/v1 and api_key to your sk-plk- key (Python openai, Node openai, LobeChat, Chatbox, etc.).

FAQ

Q: How is billing calculated? A: At the actual per-model token price, deducted from your balance after each request completes.
Q: Are my prompts stored? A: No. The gateway keeps no prompt or response content — only usage metadata (model, tokens, cost).
Q: What does HTTP 402 mean? A: Insufficient balance. Contact the operator to top up.
Q: Can invite codes be reused? A: No — each code can be used exactly once.