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.08/1M
deepseek-v4-flashDeepSeek$0.27/1M
qwen3.5-flashQwen$0.14/1M
qwen-plusQwen$0.24/1M
qwen3.5-plusQwen$0.40/1M
deepseek-v4-proDeepSeek$0.84/1M
qwen3.6-flashQwen$0.59/1M
qwq-plusQwen$0.48/1M
qwen3-maxQwen$0.96/1M
qwen3.6-plusQwen$0.99/1M