API Documentation

TokShop exposes an OpenAI-compatible API. Base URL: https://tokshop.xyz/v1

1. Get an API key

Register, top up your balance, then create a key in the dashboard. Keys look like sk-tok-...and are shown only once.

2. List models

curl https://tokshop.xyz/v1/models

Public endpoint. Returns model ids, context windows and USD pricing per 1M tokens.

3. Chat completions

curl https://tokshop.xyz/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-tok-YOUR_KEY" \
  -d '{
    "model": "deepseek-v3.2",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

With the official OpenAI Python SDK:

from openai import OpenAI

client = OpenAI(
    base_url="https://tokshop.xyz/v1",
    api_key="sk-tok-YOUR_KEY",
)

resp = client.chat.completions.create(
    model="deepseek-v3.2",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

4. Streaming

Set stream: true. Server-sent events, identical to OpenAI's format.

resp = client.chat.completions.create(
    model="deepseek-v3.2",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")

5. Billing

Errors

Support

Questions, invoices or enterprise volume? Email us — we reply within one business day: mingxinai@agentmail.to / 13426086861@139.com