Endpoints
Create Chat Completions
Endpoints
Create Chat Completions
Returns a chat.completion
object with the generated response.
POST
/
v1
/
chat
/
completions
curl --request POST \
--url https://api.shuttleai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"tools": [
{
"type": "<string>",
"function": {
"name": "<string>",
"parameters": {}
}
}
],
"tool_choice": "<string>",
"internet": true,
"citations": true,
"tone": "<string>",
"raw": true,
"image": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"logprobs": {},
"finish_reason": "<string>",
"message": {
"content": "<string>",
"role": "<string>"
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": "<string>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200 - application/json
Model response
The response is of type object
.
curl --request POST \
--url https://api.shuttleai.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"max_tokens": 123,
"temperature": 123,
"top_p": 123,
"tools": [
{
"type": "<string>",
"function": {
"name": "<string>",
"parameters": {}
}
}
],
"tool_choice": "<string>",
"internet": true,
"citations": true,
"tone": "<string>",
"raw": true,
"image": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"logprobs": {},
"finish_reason": "<string>",
"message": {
"content": "<string>",
"role": "<string>"
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"system_fingerprint": "<string>"
}