文档中心
快速了解如何使用 AItiktak 平台
快速开始
只需三步即可开始使用 AItiktak 平台调用大模型 API
1
注册账户
使用手机号注册账户,完成实名认证
2
创建 API Key
在控制台创建 API Key,设置配额和权限
3
调用 API
使用统一 API 接口调用任意大模型
# =====================================
# AItiktak 统一 API 接口调用示例
# =====================================
# 基础对话补全请求
curl -X POST https://api.aitiktak.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-plus",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 1000
}'
# 流式输出请求
curl -X POST https://api.aitiktak.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-plus",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
# 指定服务商调用(阿里百炼)
curl -X POST https://api.aitiktak.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-max",
"provider": "ali",
"messages": [{"role": "user", "content": "你好"}]
}'
# 指定服务商调用(火山引擎)
curl -X POST https://api.aitiktak.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-pro",
"provider": "volc",
"messages": [{"role": "user", "content": "你好"}]
}'API 接口详情
POST
/v1/chat/completionsstable对话补全接口,用于与大模型进行对话交互。
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 模型名称,如 qwen-plus, doubao-pro |
| messages | array | 是 | 对话消息列表,包含 role 和 content |
| temperature | number | 否 | 随机性,范围 0-2,默认 1 |
| max_tokens | integer | 否 | 最大生成 token 数,默认 1024 |
| stream | boolean | 否 | 是否启用流式输出,默认 false |
| provider | string | 否 | 指定服务商,如 ali, volc, tencent |
响应示例
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1234567890,
"model": "qwen-plus",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
}
}GET
/v1/modelsstable获取当前可用的模型列表。
请求参数
| 参数 | 类型 | 说明 |
|---|---|---|
| provider | string | 可选,按服务商筛选 |
| category | string | 可选,按类别筛选(general, fast, long-context) |
响应示例
{
"object": "list",
"data": [
{
"id": "qwen-plus",
"object": "model",
"provider": "ali",
"category": "general",
"context_window": 256000,
"pricing": {
"input": "¥0.02/1K",
"output": "¥0.06/1K"
}
}
]
}GET
/v1/usagebeta查询当前账户的使用量统计。
请求参数
| 参数 | 类型 | 说明 |
|---|---|---|
| start_date | string | 开始日期,格式 YYYY-MM-DD |
| end_date | string | 结束日期,格式 YYYY-MM-DD |
| provider | string | 可选,按服务商筛选 |
响应示例
{
"object": "usage",
"period": {
"start_date": "2026-04-01",
"end_date": "2026-04-30"
},
"total_tokens": 1000000,
"total_cost": "¥50.00",
"by_provider": [
{
"provider": "ali",
"tokens": 600000,
"cost": "¥30.00"
},
{
"provider": "volc",
"tokens": 400000,
"cost": "¥20.00"
}
]
}错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 400 | 请求参数错误 | 检查请求参数格式和必填字段 |
| 401 | 认证失败 | 检查 API Key 是否正确 |
| 403 | 配额不足 | 充值或升级套餐 |
| 429 | 请求频率超限 | 降低请求频率或升级套餐 |
| 500 | 服务器内部错误 | 联系技术支持 |
| 503 | 服务暂时不可用 | 稍后重试或切换服务商 |