POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.opentools.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "tool_calls": [
        {
          "id": "<string>",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          },
          "type": "function"
        }
      ],
      "name": "<string>"
    }
  ],
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    }
  ],
  "tool_choice": {},
  "temperature": 1,
  "max_tokens": 2
}'
{
  "id": "<string>",
  "choices": [
    {
      "message": {
        "role": "system",
        "content": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            },
            "type": "function"
          }
        ],
        "name": "<string>"
      },
      "finish_reason": "<string>",
      "index": 123
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Authentication using a bearer token

Body

application/json

Chat completion request parameters

The body is of type object.

Response

200
application/json

Successful completion

The response is of type object.