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
| Model | Provider | Price |
|---|---|---|
| qwen-turbo | Qwen | $0.08/1M |
| deepseek-v4-flash | DeepSeek | $0.27/1M |
| qwen3.5-flash | Qwen | $0.14/1M |
| qwen-plus | Qwen | $0.24/1M |
| qwen3.5-plus | Qwen | $0.40/1M |
| deepseek-v4-pro | DeepSeek | $0.84/1M |
| qwen3.6-flash | Qwen | $0.59/1M |
| qwq-plus | Qwen | $0.48/1M |
| qwen3-max | Qwen | $0.96/1M |
| qwen3.6-plus | Qwen | $0.99/1M |