5-Minute Setup
API Examples & Quickstart
Copy, paste, run. Integrate DeepSeek, Kimi, GLM, Qwen into your app in under 5 minutes.
1
Get Your API Key
Register at tokenease.io/register to get a free API key with 1M tokens. No credit card required.
Your API Key: te_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Base URL: https://tokenease.io/v1
2
Pick Your Language
TokenEase is fully OpenAI-compatible. Use the official SDKs or any HTTP client.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_TOKENEASE_API_KEY",
base_url="https://tokenease.io/v1"
)
response = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Explain quantum computing in 3 sentences"}]
)
print(response.choices[0].message.content)
Tip: Swap
model="deepseek-chat" for kimi-k3, glm-4-flash, qwen-plus, or doubao-pro.3
Streaming Responses (Real-Time Output)
For chat UIs, stream tokens as they arrive instead of waiting for the full response.
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://tokenease.io/v1")
stream = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Tell me a short story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
4
Switch Models Instantly
Change one parameter to switch between 6 providers. No new API keys, no new accounts.
# Cheapest — great for bulk model="glm-4-flash" # $0.10/M input # Best coding model="deepseek-chat" # $1.0/M input # Long context model="kimi-k3" # 256K context # General purpose model="qwen-plus" # Balanced quality/price # Fast Chinese model="doubao-pro" # ByteDance # Multimodal model="hy3-preview" # Tencent
Note: All models share the same endpoint, same authentication, same response format. Switching is literally changing one string.
Pro tip: Use
glm-4-flash for drafts and deepseek-chat for final output to cut costs by 90%.5
Deploy to Production
Ready patterns for common deployment scenarios.
# FastAPI backend (Python)
from fastapi import FastAPI
from openai import AsyncOpenAI
app = FastAPI()
client = AsyncOpenAI(api_key="YOUR_KEY", base_url="https://tokenease.io/v1")
@app.post("/chat")
async def chat(message: str):
r = await client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": message}]
)
return {"reply": r.choices[0].message.content}
Get Your Free API Key — 1M Tokens
No credit card. 14-day trial. Cancel anytime.