API Reference
Update stored chat completion metadata
Replaces the metadata object stored with a chat completion.
POST
/
v1
/
chat
/
completions
/
{completion_id}
Update stored chat completion metadata
curl --request POST \
--url https://api.synapsai.cloud/v1/chat/completions/{completion_id} \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://api.synapsai.cloud/v1/chat/completions/{completion_id}"
payload = { "metadata": {} }
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
}
}Response
Updated chat completion
Response schema for the chat completions endpoint.
⌘I
Update stored chat completion metadata
curl --request POST \
--url https://api.synapsai.cloud/v1/chat/completions/{completion_id} \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://api.synapsai.cloud/v1/chat/completions/{completion_id}"
payload = { "metadata": {} }
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
}
}