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
}
}
Send a chat completion request to a selected model
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
}
}
Authentication using a bearer token
Chat completion request parameters
The body is of type object
.
Successful completion
The response is of type object
.