API Reference
Create a chat completion
Request a chat completion. Supports tools and tool_choice for function calling, and reasoning_effort for reasoning models. Body follows ChatCompletionsRequest.
POST
/
v1
/
chat
/
completions
Create a chat completion
curl --request POST \
--url https://api.synapsai.cloud/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{}
],
"temperature": 123,
"top_p": 123,
"top_k": 123,
"max_completion_tokens": 123,
"stream": false,
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"logprobs": false,
"top_logprobs": 123,
"stop": "<string>",
"seed": 123,
"tools": [
{
"type": "function"
}
]
}
'import requests
url = "https://api.synapsai.cloud/v1/chat/completions"
payload = {
"messages": [{}],
"temperature": 123,
"top_p": 123,
"top_k": 123,
"max_completion_tokens": 123,
"stream": False,
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"logprobs": False,
"top_logprobs": 123,
"stop": "<string>",
"seed": 123,
"tools": [{ "type": "function" }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": {}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Body
application/json
Request body for chat completions endpoint describing conversation and generation parameters.
Response
200 - application/json
Chat completion response
Response schema for the chat completions endpoint.
⌘I
Create a chat completion
curl --request POST \
--url https://api.synapsai.cloud/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{}
],
"temperature": 123,
"top_p": 123,
"top_k": 123,
"max_completion_tokens": 123,
"stream": false,
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"logprobs": false,
"top_logprobs": 123,
"stop": "<string>",
"seed": 123,
"tools": [
{
"type": "function"
}
]
}
'import requests
url = "https://api.synapsai.cloud/v1/chat/completions"
payload = {
"messages": [{}],
"temperature": 123,
"top_p": 123,
"top_k": 123,
"max_completion_tokens": 123,
"stream": False,
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"logprobs": False,
"top_logprobs": 123,
"stop": "<string>",
"seed": 123,
"tools": [{ "type": "function" }]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"logprobs": {
"content": [
{
"token": "<string>",
"logprob": 123,
"top_logprobs": {}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}