Chat Completions API

By Tokuse
APIChatOpenAI
Read in other languages:한국어日本語

POST https://tokuse.com/v1/chat/completions accepts the OpenAI chat request shape and returns the model's reply in choices. An existing OpenAI SDK usually only needs a new base URL (https://tokuse.com/v1) and a model alias from the Tokuse catalog.

Item Value
Method and path POST /v1/chat/completions
Authentication Authorization: Bearer $TOKUSE_API_KEY
Model examples deepseek-flash, deepseek-v4-pro, doubao-seed-2-1-lite-260915, deepseek-v4-1-flash, kimi-k3-1-pro
Pricing Tokuse pricing and the upstream provider console

Endpoint and authentication

Send requests to https://tokuse.com/v1/chat/completions with the key in the Authorization header. Keep the key on the server. A key embedded in a browser bundle can be copied and used against your balance.

Models

The catalog changes as providers add and retire aliases. These five are the examples used in Tokuse documentation:

  • deepseek-flash
  • deepseek-v4-pro
  • doubao-seed-2-1-lite-260915
  • deepseek-v4-1-flash
  • kimi-k3-1-pro

Check the catalog for your account before a deploy. A model that works in one account may not be enabled in another.

Request

curl https://tokuse.com/v1/chat/completions \
  -H "Authorization: Bearer $TOKUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash",
    "messages": [
      {"role": "user", "content": "List two checks before rotating an API key."}
    ]
  }'

Response

{
  "id": "chatcmpl-8f2c1a",
  "object": "chat.completion",
  "created": 1763251200,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "First, confirm the new key works in staging. Second, revoke the old key only after every service has switched."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 31,
    "total_tokens": 50
  }
}

Streaming, tool calls, and image input

Set "stream": true to receive server-sent events. Read choices[0].delta.content from each chunk and stop when data: [DONE] arrives.

Tool calling follows the OpenAI schema. Pass tools, read message.tool_calls from the response, then send a tool message containing the matching tool_call_id and result before asking for the final answer.

Vision input uses content parts:

{
  "role": "user",
  "content": [
    {"type": "text", "text": "What does this error screen say?"},
    {"type": "image_url", "image_url": {"url": "https://example.com/error.png"}}
  ]
}

Not every alias accepts images. Test the exact model you plan to use with the SDK version in production.

Notes and limits

  • Token and rate limits come from the routed model and the upstream account, not from the endpoint name.
  • Provider-specific parameters may be ignored or rejected. Test JSON output, tool calls, and long prompts against the real model.
  • When an upstream request fails, log the gateway request ID and the upstream error message together. The HTTP status alone rarely explains whether the model, the key, or the input caused the failure.

Billing

This page does not list prices. Input and output tokens are billed at the rates shown on the Tokuse pricing page and in the upstream provider console. Check /pricing and the upstream console for the current numbers before sending production traffic.