Documentation

Get started with the TokenAPI integration

Quick Start

# Install
pip install openai

# Use TokenAPI
from openai import OpenAI

client = OpenAI(
    api_key="your_api_key_here",
    base_url="https://api.ttokenapi.com/v1"
)

response = client.chat.completions.create(
    model="qwen-turbo",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Authentication

All requests require your API key in the Authorization header

# Set via environment variable
export OPENAI_API_KEY="your_tokenapi_key"
export OPENAI_BASE_URL="https://api.ttokenapi.com/v1"

Supported Models

ModelProviderPrice
qwen-turboQwen$0.10/1M
qwen-turbo-latestQwen$0.10/1M
qwen-flashQwen$0.25/1M
deepseek-v4-flashDeepSeek$0.35/1M
qwen-plusQwen$0.35/1M
qwen3.5-35b-a3bQwen$0.35/1M
qwen3.5-plusQwen$0.82/1M
qwen3.6-flashQwen$1.23/1M
deepseek-v4-proDeepSeek$1.20/1M
qwen3-maxQwen$1.72/1M