API reference
Works with
MCP server registry
Create Generation
Send a chat completion request to a selected model
POST
/
v1
/
chat
/
completions
Copy
Ask AI
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
}'
Copy
Ask AI
{
"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
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
.
Copy
Ask AI
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
}'
Copy
Ask AI
{
"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
}
}
Assistant
Responses are generated using AI and may contain mistakes.