{
"model": "gpt-4o",
"response_format": {
"type": "json_object"
},
"messages": [
{
"role": "system",
"content": "You are a helpful assistant designed to output JSON."
},
{
"role": "user",
"content": "Who won the world series in 2020?"
}
]
}
curl --location --request POST 'https://api.b3n.fun/v1/chat/completions' \
--header 'Authorization: sk-abc' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4o",
"response_format": {
"type": "json_object"
},
"messages": [
{
"role": "system",
"content": "You are a helpful assistant designed to output JSON."
},
{
"role": "user",
"content": "Who won the world series in 2020?"
}
]
}'
{
"id": "chatcmpl-9RL23uLmhKznke8ADyo6U62sbYEPV",
"object": "chat.completion",
"created": 1716302731,
"model": "gpt-4o-2024-05-13",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\n \"year\": 2020,\n \"winner\": \"Los Angeles Dodgers\"\n}"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 31,
"completion_tokens": 19,
"total_tokens": 50
},
"system_fingerprint": "fp_927397958d"
}