Authorization: Bearer ********************
{
"model": "gemini-2.5-pro",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}
curl --location -g --request POST '{{YOUR_BASE_URL}}/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gemini-2.5-pro",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'
{
"id": "chatcmpl-20250822104123231439089k9Gd8zcq",
"model": "gemini-2.5-pro",
"object": "chat.completion",
"created": 1755859288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello there! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 492,
"total_tokens": 500,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 8,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 482
},
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": null
}
}