TOKI

Quickstart

Make your first TOKI API request with an OpenAI-compatible client.

Before You Start

  1. Register and sign in at tokiai.ai.
  2. If you need quota, go to Product Center and choose a Token Plan.
  3. Open the API Keys page and click Create Key.
  4. Copy the generated API key and store it securely.

Your API key can be used to call the API. Store it in an environment variable or secret manager, and never expose it in frontend code, public repositories, or client packages.

Make Your First Request

TOKI API follows common OpenAI API request and response formats. You can use standard HTTP requests or an OpenAI-compatible SDK by changing the base URL and API key.

Using the OpenAI SDK (Node.js)

First, install the official OpenAI SDK:

npm install openai

Then, configure it to use the TOKI base URL:

TypeScript
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://www.tokiai.ai/v1',
  apiKey: process.env.TOKI_API_KEY,
});

const completion = await openai.chat.completions.create({
  model: 'deepseek/deepseek-chat-v3',
  messages: [
    { role: 'user', content: 'Hello, what can you do?' }
  ],
});

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

The model value should be a model identifier shown on the model page or in the console. Context length, input and output types, and pricing can differ by model.

Using cURL Directly

You can also use the HTTP API with any language:

cURL
curl https://www.tokiai.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKI_API_KEY" \
  -d '{
    "model": "deepseek/deepseek-chat-v3",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Next Steps

On this page