API Documentation

Multi-Model AI Gateway · Global Access · High Availability

Quick Start

TokenEase provides a unified API interface supporting DeepSeek, Zhipu GLM, Alibaba Qwen, and other mainstream AI models.

Base URL

https://tokenease.io/v1

Authentication

Include your API Key in the request header:

Authorization: Bearer YOUR_API_KEY

Supported Models

DeepSeek V4 Flash
$0.50 / 1M input tokens · $1 / 1M output tokens

High-speed inference · Function Call support

DeepSeek V4 Pro
$4 / 1M input tokens · $8 / 1M output tokens

High-precision reasoning

GLM-5.1
$4 / 1M input tokens · $8 / 1M output tokens

Zhipu AI's latest model

Qwen-Plus
$1.5 / 1M input tokens · $3 / 1M output tokens

Alibaba Tongyi Qianwen

Doubao Pro
$0.5 / 1M input tokens · $1 / 1M output tokens

ByteDance Doubao

Rate Limits

100
RPM (Requests/min)
10,000
TPM (Tokens/min)
1,000
RPD (Requests/day)

Chat Completions API

Use the chat completions endpoint for multi-turn conversations with AI models.

POST /chat/completions

Request Parameters

model string Model name, e.g. deepseek-v4 or glm-5.1
messages array Array of messages, each with role and content
temperature float Sampling temperature, 0-2, default 0.7
max_tokens integer Maximum number of tokens to generate

Request Example

curl -X POST https://tokenease.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello, who are you?"}
    ],
    "temperature": 0.7,
    "max_tokens": 1000
  }'

Response Example

{
  "id": "chatcmpl-xxxxx",
  "object": "chat.completion",
  "created": 1748390400,
  "model": "deepseek-v4",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! I'm TokenEase AI assistant..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 150,
    "total_tokens": 170
  }
}

Models List API

Get all available models and their details.

GET /models

Response Example

{
  "object": "list",
  "data": [
    {
      "id": "deepseek-v4",
      "object": "model",
      "name": "DeepSeek V4 Flash",
      "provider": "DeepSeek",
      "context_length": 64000,
      "price_per_1m_tokens": 0.5
    },
    {
      "id": "glm-5.1",
      "object": "model",
      "name": "GLM-5.1",
      "provider": "Zhipu AI",
      "context_length": 128000,
      "price_per_1m_tokens": 8
    },
    {
      "id": "qwen-plus",
      "object": "model",
      "name": "Qwen-Plus",
      "provider": "Alibaba",
      "context_length": 131072,
      "price_per_1m_tokens": 3
    }
  ]
}

Error Codes

400 Bad Request Invalid request parameters
401 Unauthorized Invalid or expired API Key
403 Forbidden Insufficient balance or quota exceeded
429 Rate Limited Request rate limit exceeded
500 Server Error Internal server error

SDK Examples

Python

# Install
pip install openai

# Usage
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://tokenease.io/v1"
)

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

JavaScript / Node.js

// Install
// npm install openai

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://tokenease.io/v1'
});

const response = await client.chat.completions.create({
  model: 'deepseek-v4',
  messages: [
    { role: 'user', content: 'Hello!' }
  ]
});

console.log(response.choices[0].message.content);

cURL

curl https://tokenease.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Get Started

Sign up now, get free credits, and experience the power of TokenEase.

View Pricing Back to Home