Try Bifrost Enterprise free for 14 days. Explore now
curl --request POST \
--url http://localhost:8080/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-4",
"messages": [
{
"role": "assistant",
"name": "<string>",
"content": "<string>",
"tool_call_id": "<string>",
"refusal": "<string>",
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"reasoning": "<string>",
"reasoning_details": [
{
"id": "<string>",
"index": 123,
"type": "reasoning.summary",
"summary": "<string>",
"text": "<string>",
"signature": "<string>",
"data": "<string>"
}
],
"annotations": [
{
"type": "<string>",
"url_citation": {
"start_index": 123,
"end_index": 123,
"title": "<string>",
"url": "<string>",
"sources": {},
"type": "<string>"
}
}
],
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"index": 123,
"type": "<string>",
"id": "<string>"
}
]
}
],
"fallbacks": [
"<string>"
],
"stream": true,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": true,
"max_completion_tokens": 123,
"metadata": {},
"modalities": [
"<string>"
],
"parallel_tool_calls": true,
"presence_penalty": 0,
"prompt_cache_key": "<string>",
"reasoning": {
"effort": "none",
"max_tokens": 123
},
"response_format": {},
"safety_identifier": "<string>",
"service_tier": "<string>",
"stream_options": {
"include_obfuscation": true,
"include_usage": true
},
"store": true,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"type": "function",
"custom": {},
"cache_control": {
"type": "ephemeral",
"ttl": "<string>"
}
}
],
"seed": 123,
"top_p": 0.5,
"top_logprobs": 10,
"stop": "<string>",
"prediction": {
"type": "<string>",
"content": "<string>"
},
"prompt_cache_retention": "in-memory",
"web_search_options": {
"search_context_size": "low",
"user_location": {
"type": "<string>",
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
}
}
},
"truncation": "<string>",
"user": "<string>",
"verbosity": "low"
}
'{
"id": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"log_probs": {
"content": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>",
"top_logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
]
}
],
"refusal": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
],
"text_offset": [
123
],
"token_logprobs": [
123
],
"tokens": [
"<string>"
],
"top_logprobs": [
{}
]
},
"text": "<string>",
"delta": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"reasoning": "<string>",
"reasoning_details": [
{
"id": "<string>",
"index": 123,
"type": "reasoning.summary",
"summary": "<string>",
"text": "<string>",
"signature": "<string>",
"data": "<string>"
}
],
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"index": 123,
"type": "<string>",
"id": "<string>"
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"service_tier": "<string>",
"system_fingerprint": "<string>",
"usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
},
"extra_fields": {
"request_type": "<string>",
"provider": "openai",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
},
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "<string>",
"last_updated": "<string>",
"snippet": "<string>",
"source": "<string>"
}
],
"videos": [
{
"url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_width": 123,
"thumbnail_height": 123,
"duration": 123
}
],
"citations": [
"<string>"
]
}Creates a completion for the provided messages. Supports streaming via SSE.
curl --request POST \
--url http://localhost:8080/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-4",
"messages": [
{
"role": "assistant",
"name": "<string>",
"content": "<string>",
"tool_call_id": "<string>",
"refusal": "<string>",
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"reasoning": "<string>",
"reasoning_details": [
{
"id": "<string>",
"index": 123,
"type": "reasoning.summary",
"summary": "<string>",
"text": "<string>",
"signature": "<string>",
"data": "<string>"
}
],
"annotations": [
{
"type": "<string>",
"url_citation": {
"start_index": 123,
"end_index": 123,
"title": "<string>",
"url": "<string>",
"sources": {},
"type": "<string>"
}
}
],
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"index": 123,
"type": "<string>",
"id": "<string>"
}
]
}
],
"fallbacks": [
"<string>"
],
"stream": true,
"frequency_penalty": 0,
"logit_bias": {},
"logprobs": true,
"max_completion_tokens": 123,
"metadata": {},
"modalities": [
"<string>"
],
"parallel_tool_calls": true,
"presence_penalty": 0,
"prompt_cache_key": "<string>",
"reasoning": {
"effort": "none",
"max_tokens": 123
},
"response_format": {},
"safety_identifier": "<string>",
"service_tier": "<string>",
"stream_options": {
"include_obfuscation": true,
"include_usage": true
},
"store": true,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"type": "function",
"custom": {},
"cache_control": {
"type": "ephemeral",
"ttl": "<string>"
}
}
],
"seed": 123,
"top_p": 0.5,
"top_logprobs": 10,
"stop": "<string>",
"prediction": {
"type": "<string>",
"content": "<string>"
},
"prompt_cache_retention": "in-memory",
"web_search_options": {
"search_context_size": "low",
"user_location": {
"type": "<string>",
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
}
}
},
"truncation": "<string>",
"user": "<string>",
"verbosity": "low"
}
'{
"id": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"log_probs": {
"content": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>",
"top_logprobs": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
]
}
],
"refusal": [
{
"bytes": [
123
],
"logprob": 123,
"token": "<string>"
}
],
"text_offset": [
123
],
"token_logprobs": [
123
],
"tokens": [
"<string>"
],
"top_logprobs": [
{}
]
},
"text": "<string>",
"delta": {
"role": "<string>",
"content": "<string>",
"refusal": "<string>",
"audio": {
"id": "<string>",
"data": "<string>",
"expires_at": 123,
"transcript": "<string>"
},
"reasoning": "<string>",
"reasoning_details": [
{
"id": "<string>",
"index": 123,
"type": "reasoning.summary",
"summary": "<string>",
"text": "<string>",
"signature": "<string>",
"data": "<string>"
}
],
"tool_calls": [
{
"function": {
"name": "<string>",
"arguments": "<string>"
},
"index": 123,
"type": "<string>",
"id": "<string>"
}
]
}
}
],
"created": 123,
"model": "<string>",
"object": "<string>",
"service_tier": "<string>",
"system_fingerprint": "<string>",
"usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_read_tokens": 123,
"cached_write_tokens": 123
},
"completion_tokens": 123,
"completion_tokens_details": {
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"audio_tokens": 123,
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123,
"image_tokens": 123,
"rejected_prediction_tokens": 123
},
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"reasoning_tokens_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123,
"request_cost": 123,
"total_cost": 123
}
},
"extra_fields": {
"request_type": "<string>",
"provider": "openai",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
},
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "<string>",
"last_updated": "<string>",
"snippet": "<string>",
"source": "<string>"
}
],
"videos": [
{
"url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_width": 123,
"thumbnail_height": 123,
"duration": 123
}
],
"citations": [
"<string>"
]
}Model in provider/model format (e.g., openai/gpt-4)
"openai/gpt-4"
List of messages in the conversation
Show child attributes
Fallback models in provider/model format
Whether to stream the response
-2 <= x <= 2Show child attributes
-2 <= x <= 2Show child attributes
Format for the response
Show child attributes
0 <= x <= 2none, auto, required Show child attributes
Deterministic sampling seed
Nucleus sampling parameter
0 <= x <= 1Number of most likely tokens to return at each position
0 <= x <= 20Up to 4 sequences where the API will stop generating tokens
Predicted output content for the model to reference (OpenAI only). Can reduce latency.
Show child attributes
Prompt cache retention policy
in-memory, 24h Web search options for chat completions (OpenAI only)
Show child attributes
low, medium, high Successful response
Show child attributes
Token usage information
Show child attributes
Additional fields included in responses
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?