POST
/
chat
/
completions
curl --request POST \
  --url https://app.openpipe.ai/api/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "false": 123,
  "function_call": "none",
  "functions": [
    {
      "description": "<string>",
      "name": "<string>",
      "parameters": {}
    }
  ],
  "max_tokens": 123,
  "messages": [
    {
      "content": "<string>",
      "role": "system"
    }
  ],
  "model": "<string>",
  "reqPayload": {
    "false": 123,
    "function_call": "none",
    "functions": [
      {
        "description": "<string>",
        "name": "<string>",
        "parameters": {}
      }
    ],
    "max_tokens": 123,
    "messages": [
      {
        "content": "<string>",
        "role": "system"
      }
    ],
    "model": "<string>",
    "response_format": {
      "type": "text"
    },
    "stream": true,
    "temperature": 123,
    "tool_choice": "none",
    "tools": [
      {
        "function": {
          "description": "<string>",
          "name": "<string>",
          "parameters": {}
        },
        "type": "function"
      }
    ]
  },
  "response_format": {
    "type": "text"
  },
  "stream": true,
  "temperature": 123,
  "tool_choice": "none",
  "tools": [
    {
      "function": {
        "description": "<string>",
        "name": "<string>",
        "parameters": {}
      },
      "type": "function"
    }
  ]
}'
{
  "choices": [
    {
      "finish_reason": "length",
      "index": 123,
      "logprobs": {
        "content": [
          {
            "bytes": [
              123
            ],
            "logprob": 123,
            "token": "<string>",
            "top_logprobs": [
              {
                "bytes": [
                  123
                ],
                "logprob": 123,
                "token": "<string>"
              }
            ]
          }
        ]
      },
      "message": {
        "content": "<string>",
        "function_call": {
          "arguments": "<string>",
          "name": "<string>"
        },
        "role": "assistant",
        "tool_calls": [
          {
            "function": {
              "arguments": "<string>",
              "name": "<string>"
            },
            "id": "<string>",
            "type": "function"
          }
        ]
      }
    }
  ],
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
headerrequired

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

Body

application/json
false
number | null
function_call
Available options:
none
functions
object[]
max_tokens
number | null
messages
object[]
  • Option 1

  • Option 2

  • Option 3

  • Option 4

  • Option 5

model
string
reqPayload
object

DEPRECATED. Use the top-level fields instead

response_format
object
stream
boolean
default: false
temperature
number | null
tool_choice
Available options:
none
tools
object[]

Response

200 - application/json
  • Option 1

  • Option 2

  • Option 3

choices
object[]
required
created
number
required
id
string
required
model
string
required
object
enum<string>
required
Available options:
chat.completion
usage
object