Chat completions
curl --request POST \
--url https://api.xhuoapi.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
'import requests
url = "https://api.xhuoapi.ai/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'deepseek-v4-flash', messages: [{role: 'user', content: 'Hello'}]})
};
fetch('https://api.xhuoapi.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}エンドポイント
チャット補完
OpenAI Chat Completions 形式。すべてのチャットモデルで使え、ストリーミング・ツール呼び出し・JSON モードに対応。
POST
/
chat
/
completions
Chat completions
curl --request POST \
--url https://api.xhuoapi.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
'import requests
url = "https://api.xhuoapi.ai/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'deepseek-v4-flash', messages: [{role: 'user', content: 'Hello'}]})
};
fetch('https://api.xhuoapi.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}プレイグラウンドにトークンを入力すると実際のリクエストを送れます。通常の呼び出しと同じく課金されます。
承認
Token from https://api.xhuoapi.ai
ボディ
application/json
Model ID. See the models page.
例:
"deepseek-v4-flash"
Show child attributes
Show child attributes
例:
[{ "role": "user", "content": "Hello" }]
Return server-sent events.
必須範囲:
0 <= x <= 2OpenAI-style function tools.
e.g. {"type": "json_object"}