认证鉴权
简介
XinnetModel API 使用 API Key 进行认证。所有 API 请求都必须在 HTTP 请求头中包含有效的 API Key。
获取API Key
请访问 新网-模型服务平台 来创建和管理您的 API Key。
调用地址
XinnetModel API 调用地址:
GET https://airouter.xincache.cn/v1/models
最简调用
请将 {api_key} 替换为您的 API Key。
curl --location 'https://airouter.xincache.cn/v1/chat/completions' \
--header "Authorization: Bearer {api_key}" \
--header 'Content-Type: application/json' \
--data '{
"model": "deepseek-ai/DeepSeek-R1",
"messages": [
{
"role": "user",
"content": "一句话描述新网数码这家公司。"
}
]
}' | jq .
你可能看到的返回结果。
{
"id": "0a7919c4-981e-438b-ad30-e943b96882b6",
"object": "chat.completion",
"created": 1763015400,
"model": "deepseek-r1-250528",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你是一个客服助手。"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 348,
"total_tokens": 358,
"prompt_tokens_details": null,
"completion_tokens_details": {
"audio_tokens": 0,
"reasoning_tokens": 185,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
},
"system_fingerprint": "",
"search_result": null
}
Last modified: 20 May 2026