Try Bifrost Enterprise free for 14 days. Explore now
curl --request POST \
--url http://localhost:8080/openai/v1/completions \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-3.5-turbo-instruct",
"prompt": "<string>",
"stream": true,
"max_tokens": 123,
"temperature": 1,
"top_p": 123,
"frequency_penalty": 0,
"presence_penalty": 0,
"logit_bias": {},
"logprobs": 123,
"n": 123,
"stop": "<string>",
"suffix": "<string>",
"echo": true,
"best_of": 123,
"user": "<string>",
"seed": 123,
"fallbacks": [
"<string>"
]
}
'{
"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>",
"message": {
"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>"
}
]
},
"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>"
}
]
}
}
],
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_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,
"cached_tokens": 123
},
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_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>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}Creates a text completion using OpenAI-compatible format. This is the legacy completions API.
Note: This endpoint also works without the /v1 prefix (e.g., /openai/completions).
curl --request POST \
--url http://localhost:8080/openai/v1/completions \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-3.5-turbo-instruct",
"prompt": "<string>",
"stream": true,
"max_tokens": 123,
"temperature": 1,
"top_p": 123,
"frequency_penalty": 0,
"presence_penalty": 0,
"logit_bias": {},
"logprobs": 123,
"n": 123,
"stop": "<string>",
"suffix": "<string>",
"echo": true,
"best_of": 123,
"user": "<string>",
"seed": 123,
"fallbacks": [
"<string>"
]
}
'{
"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>",
"message": {
"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>"
}
]
},
"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>"
}
]
}
}
],
"model": "<string>",
"object": "<string>",
"system_fingerprint": "<string>",
"usage": {
"prompt_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123,
"cached_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,
"cached_tokens": 123
},
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_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>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}Model identifier
"gpt-3.5-turbo-instruct"
The prompt(s) to generate completions for
Whether to stream the response
0 <= x <= 2-2 <= x <= 2-2 <= x <= 2Show child attributes
Was this page helpful?