API Documentation

Aitokends provides an OpenAI-compatible API. You can use any OpenAI SDK or HTTP client. Just change the base URL and API key.

Quick Start

Get started in 3 minutes with any OpenAI-compatible SDK:

# Python (OpenAI SDK v1+)
from openai import OpenAI

client = OpenAI(
    base_url="https://aitokends.com/v1/",
    api_key="your_aitokends_api_key_here"
)

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

Available Models

Model IDDescription
deepseek-v4-flashFast, cost-efficient. For chat, content generation, simple tasks.
deepseek-v4-proDeep reasoning. For complex analysis, code generation, advanced logic.

cURL Example

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

Node.js Example

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://aitokends.com/v1/",
  apiKey: "your_aitokends_api_key_here"
});

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

Error Codes

HTTP CodeMeaning
400Bad request — invalid model name or request format
401Invalid or missing API key
402Insufficient balance. Top up to continue.
403Forbidden — your plan does not have access to this model
429Rate limit exceeded. Slow down requests.
500Upstream API error. Retry with exponential backoff.

Pricing & Billing

Usage is deducted from your balance in real-time. Each API call costs:

cost = prompt_tokens × input_price + completion_tokens × output_price

Check your balance and usage history in your dashboard.