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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
messages
object[]
required
model
string
required
audio
object | null
function_call
Available options:
none
functions
object[]
tool_choice
Available options:
none
tools
object[]
n
number
max_tokens
number | null
max_completion_tokens
number | null
temperature
number
top_p
number | null
presence_penalty
number | null
frequency_penalty
number | null
stop
response_format
object
logprobs
boolean
top_logprobs
number | null
stream_options
object
store
boolean
metadata
object | null
stream
boolean
default:
false

Response

200
application/json
Successful response
id
string
required
object
enum<string>
required
Available options:
chat.completion
created
number
required
model
string
required
choices
object[]
required
usage
object