OpenAI 応答 API を会話に使用します。応答 API は、より柔軟な入力を持つ最新の OpenAI API 形式です。
/api/ai/v1/responsesBearer YOUR_API_KEY| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
model | string | 必須 | モデル名、例: deepseek-v4.1-flash、qwen3.8-max |
input | string | 必須 | 入力テキストまたは会話内容 |
max_tokens | integer | 任意 | 出力トークンの最大数 |
temperature | float | 任意 | サンプリング温度、乱数制御 (0-2) |
stream | boolean | 任意 | ストリーミング応答を有効にします。SSE の場合は true に設定 |
| パラメータ | 型 | 説明 |
|---|---|---|
id | string | 一意の応答 ID |
model | string | 使用されたモデル |
output | string | 生成されたテキスト出力 |
usage | object | prompt_tokens、completion_tokens、total_tokens を含むトークン使用統計 |
curl --location 'https://your-domain.com/api/ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"input": "Hello, who are you?",
"max_tokens": 1000,
"temperature": 0.7
}'import requests
response = requests.post(
"https://your-domain.com/api/ai/v1/responses",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
json={
"model": "deepseek-v4.1-flash",
"input": "Hello, who are you?",
"max_tokens": 1000,
"temperature": 0.7
}
)
print(response.json())curl --location 'https://your-domain.com/api/ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"input": "Hello",
"max_tokens": 1000,
"stream": true
}'