Chat Completions
Chat Completions
Getting Started
Features
- Request Logs
- Datasets
- Fine Tuning
- Direct Preference Optimization (DPO)
- Evaluations
- Criteria
- Chat Completions
- Caching
- Updating Metadata Tags
- Pruning Rules
- Fallback
- Mixture of Agents
- External Models
API Reference
- Logs
- Chat Completions
- Datasets
- Models
- Criteria
Pricing
Chat Completions
Chat Completions
OpenAI-compatible route for generating inference and optionally logging the request.
POST
/
chat
/
completions
curl --request POST \
--url https://api.openpipe.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"model": "<string>",
"audio": {
"format": "wav",
"voice": "alloy"
},
"function_call": "none",
"functions": [
{
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
}
],
"tool_choice": "none",
"tools": [
{
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
},
"type": "function"
}
],
"n": 123,
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"stop": "<string>",
"response_format": {
"type": "text"
},
"logprobs": true,
"top_logprobs": 123,
"stream_options": {
"include_usage": true
},
"store": true,
"metadata": {},
"stream": false
}'
{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"finish_reason": "length",
"index": 123,
"message": {
"reasoning_content": "<string>",
"content": null,
"refusal": "<string>",
"role": "assistant",
"function_call": {
"name": "",
"arguments": ""
},
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
},
"type": "function"
}
]
},
"logprobs": null,
"content_filter_results": {},
"criteria_results": {}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_cache_hit_tokens": 123,
"prompt_cache_miss_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123,
"audio_tokens": 123,
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"cached_tokens": 123,
"audio_tokens": 123
},
"criteria": {}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Available options:
none
Available options:
none
Response
200
application/json
Successful response
Available options:
chat.completion
Available options:
length
Available options:
assistant
curl --request POST \
--url https://api.openpipe.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"model": "<string>",
"audio": {
"format": "wav",
"voice": "alloy"
},
"function_call": "none",
"functions": [
{
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
}
],
"tool_choice": "none",
"tools": [
{
"function": {
"name": "<string>",
"parameters": {},
"description": "<string>",
"strict": true
},
"type": "function"
}
],
"n": 123,
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"stop": "<string>",
"response_format": {
"type": "text"
},
"logprobs": true,
"top_logprobs": 123,
"stream_options": {
"include_usage": true
},
"store": true,
"metadata": {},
"stream": false
}'
{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"finish_reason": "length",
"index": 123,
"message": {
"reasoning_content": "<string>",
"content": null,
"refusal": "<string>",
"role": "assistant",
"function_call": {
"name": "",
"arguments": ""
},
"tool_calls": [
{
"id": "<string>",
"function": {
"name": "<string>",
"arguments": "<string>"
},
"type": "function"
}
]
},
"logprobs": null,
"content_filter_results": {},
"criteria_results": {}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_cache_hit_tokens": 123,
"prompt_cache_miss_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123,
"audio_tokens": 123,
"text_tokens": 123,
"accepted_prediction_tokens": 123,
"rejected_prediction_tokens": 123
},
"prompt_tokens_details": {
"cached_tokens": 123,
"audio_tokens": 123
},
"criteria": {}
}
}