OpenToken Docs

Quickstart

Point the OpenAI SDK at OpenToken and make your first call.

OpenToken implements the OpenAI Chat Completions API. Change only the base URL and the API key, then call any registered model using the {provider}/{model} id format.

Create an API key

In the console, open a workspace and create a server-side key. Keys start with sk-optk- and the secret is shown only once.

Point the SDK at OpenToken

Set the client base URL to https://api.opentoken.kr/v1 and use your OpenToken key as the API key.

Send your first request

from openai import OpenAI

client = OpenAI(
    base_url="https://api.opentoken.kr/v1",
    api_key="sk-optk-...",
)

resp = client.chat.completions.create(
    model="google/gemini-3-flash",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.opentoken.kr/v1",
  apiKey: process.env.OPENTOKEN_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "google/gemini-3-flash",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);
curl https://api.opentoken.kr/v1/chat/completions \
  -H "Authorization: Bearer $OPENTOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-3-flash",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'

Model ids use the {provider}/{model} format. Call GET /v1/models to list what is registered — see Models.

Next steps