チャットモデルは一連のメッセージを入力として受け取り、モデルが生成したメッセージを出力として返します。チャット形式は複数回のやり取りを容易にするために設計されていますが、会話のない単一のタスクにも同様に有用です。 Request
Body Params application/json
{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}],
"stream":true
}
Request Code Samples
curl --location --request POST 'https://api.302.ai/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}],
"stream":true
}'
Responses
application/json {
"id": "chatcmpl-D2AFSMEBd0Z4DiiOiVCIBnaEO3Zti",
"object": "chat.completion.chunk",
"created": 1769408453,
"model": "gpt-4o",
"service_tier": "default",
"system_fingerprint": "fp_0598406000",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": "",
"refusal": null
},
"logprobs": null,
"finish_reason": null
}
],
"usage": null
}
Modified at 2026-01-20 08:28:14