快速开始
30秒内开始使用 Celuxe API。
⚡ 3步接入
- 1. 注册账号并获取 API Key
- 2. 安装 SDK(可选)
- 3. 发送你的第一个请求
获取 API Key
登录后在仪表盘中创建 API Key。每个账号最多5个 Key。
YOUR_API_KEY
sk-celuxe-A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6
⚠️ 安全提醒:
不要在前端代码或公开仓库中暴露 API Key。用环境变量存储。
发送第一个请求
使用任意 HTTP 客户端发送请求。所有请求走 HTTPS。
curl https://api.celuxe.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello!"}
],
"max_tokens": 100
}'
响应示例
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1715623456,
"model": "gpt-4o",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 12,
"total_tokens": 22
}
}
聊天完成 API
端点
POST https://api.celuxe.com/v1/chat/completions
请求参数
model
string required
messages
array required
temperature
number optional, default: 0.7
max_tokens
integer optional
stream
boolean optional, default: false
Python SDK
安装官方 Python SDK:
pip install celuxe-sdk
使用示例:
from celuxe import Celuxe
client = Celuxe(api_key="YOUR_API_KEY")
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
Node.js SDK
安装官方 Node.js SDK:
npm install celuxe-sdk
使用示例:
import Celuxe from 'celuxe-sdk';
const client = new Celuxe({ apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(response.choices[0].message.content);
计费说明
按 Token 计费
输入和输出 token 分别计费。实时价格可在模型页面查看。
5.5% 平台费
包含在显示价格中,用于持续优化路由基础设施。
无月费
不收取月费或最低消费。只按实际用量计费。
免费额度
新用户赠送免费额度,无需绑定信用卡。