AI API 文档
强大的AI能力,简单的API接口。只需几行代码,即可将先进的AI功能集成到您的应用中。 支持聊天、内容生成、智能分析等多种功能。
5分钟快速开始5分钟快速开始
1. 首先,获取您的API密钥:
# 注册获取API密钥
curl -X POST http://localhost:5000/register \
-H "Content-Type: application/json" \
-d '{"email": "your-email@example.com"}'
2. 使用API密钥进行聊天:
# Python示例
import requests
api_key = "your-api-key-here"
response = requests.post(
"http://localhost:5000/api/chat",
headers={"X-API-Key": api_key},
json={"message": "你好,介绍一下你自己"}
)
print(response.json())
3. 查看使用统计:
# 检查API使用情况 curl "http://localhost:5000/api/usage?api_key=your-api-key"
API端点
POST
/api/chat
AI聊天接口,支持自然语言对话和内容生成。
请求头
X-API-Key
string, required
请求体
message
string, required
temperature
number, optional (0.1-1.0)
# 请求示例
{
"message": "写一篇关于人工智能的文章",
"temperature": 0.7
}
GET
/api/usage
获取API使用统计,包括剩余额度、调用次数等。
查询参数
api_key
string, required
GET
/api/status
获取服务状态和健康检查。
准备好开始了吗?
选择适合您需求的定价计划,立即开始构建AI驱动的应用。
查看定价计划