{
"model": "gpt-4o-audio-preview",
"modalities": [
"audio",
"text"
],
"audio": {
"format": "wav",
"voice": "alloy"
},
"messages": [
{
"role": "user",
"content": "请用中文回答:你能听到我的声音吗?并用语音回复我。"
}
]
}
curl --location --request POST 'https://api.wenwen-ai.com/v1/chat/completions' \
--header 'Authorization: Bearer {API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o-audio-preview",
"modalities": [
"audio",
"text"
],
"audio": {
"format": "wav",
"voice": "alloy"
},
"messages": [
{
"role": "user",
"content": "请用中文回答:你能听到我的声音吗?并用语音回复我。"
}
]
}'
{
"id": "chatcmpl-BqebNpDZkLbdiwDBINEDTuUBCQK5L",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": null,
"refusal": null,
"role": "assistant",
"annotations": [],
"audio": {
"id": "audio_686bb3bec2608191b1d7efbfbd8bdb51",
"data": "UklGRv////9XQVZFZ......AB4AgABcAFQAAwA=",
"expires_at": 1751892430,
"transcript": "是的,我可以听到你的声音。"
},
"function_call": null,
"tool_calls": null
}
}
],
"created": 1751888829,
"model": "gpt-4o-audio-preview-2024-12-17",
"object": "chat.completion",
"service_tier": "default",
"system_fingerprint": "fp_bf8dbd2ceb",
"usage": {
"completion_tokens": 67,
"prompt_tokens": 27,
"total_tokens": 94,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 50,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
"text_tokens": 17
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0,
"text_tokens": 27,
"image_tokens": 0
}
}
}