curl --request POST \
--url https://api.example.com/v1/chat/completions/{completion_id} \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/v1/chat/completions/{completion_id}"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/v1/chat/completions/{completion_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/chat/completions/{completion_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/chat/completions/{completion_id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/chat/completions/{completion_id}")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/chat/completions/{completion_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 1,
"message": {
"role": "<string>",
"annotations": "<unknown>",
"audio": "<unknown>",
"content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "<string>"
}
]
},
"logprobs": "<unknown>"
}
],
"created": 1,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_tokens": 1,
"completion_tokens_details": "<unknown>",
"prompt_tokens_details": "<unknown>"
},
"service_tier": "<string>",
"system_fingerprint": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Update Chat Completion
curl --request POST \
--url https://api.example.com/v1/chat/completions/{completion_id} \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.example.com/v1/chat/completions/{completion_id}"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.example.com/v1/chat/completions/{completion_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/chat/completions/{completion_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/chat/completions/{completion_id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/chat/completions/{completion_id}")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/chat/completions/{completion_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"finish_reason": "<string>",
"index": 1,
"message": {
"role": "<string>",
"annotations": "<unknown>",
"audio": "<unknown>",
"content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "<string>"
}
]
},
"logprobs": "<unknown>"
}
],
"created": 1,
"id": "<string>",
"model": "<string>",
"object": "<string>",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_tokens": 1,
"completion_tokens_details": "<unknown>",
"prompt_tokens_details": "<unknown>"
},
"service_tier": "<string>",
"system_fingerprint": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Path Parameters
ID of the chat completion
Body
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Response
Chat completion updated successfully
Represents a chat completion response returned by model, based on the provided input.
A list of chat completion choices. Can be more than one if n is greater than 1.
Show child attributes
Show child attributes
The Unix timestamp (in seconds) of when the chat completion was created.
x >= 0A unique identifier for the chat completion.
The model used for the chat completion.
The object type, which is always chat.completion.
Usage statistics for the completion request.
Show child attributes
Show child attributes
The service tier used for processing the request. This field is only included if the service_tier parameter is specified in the request.
This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.