API 文档AI 模型接口补全
原生OpenAI格式
基于给定提示创建文本补全
原生OpenAI格式
基于给定提示创建文本补全
Base URL
https://autorouter.top— Production
Authentication
BearerAuth: http (bearer)
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1/completions
原生OpenAI格式
基于给定提示创建文本补全
Request Body
Content-Type: application/json
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | - |
prompt | oneOf | Yes | - |
max_tokens | integer | No | - |
temperature | number | No | - |
top_p | number | No | - |
n | integer | No | - |
stream | boolean | No | - |
stop | oneOf | No | - |
suffix | string | No | - |
echo | boolean | No | - |
Responses
200: 成功创建响应
Content-Type: application/json
请求示例
curl -X POST "https://autorouter.top/v1/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"prompt": "string"
}'响应示例
{
"id": "string",
"object": "text_completion",
"created": 0,
"model": "string",
"choices": [
{
"text": "string",
"index": 0,
"finish_reason": "string"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
}
}