curl --request POST \ --url https://api.egp.scale.com/v4/chat-completions \ --header 'Content-Type: application/json' \ --data '{ "messages": [ { "content": "<string>", "role": "user" } ], "account_id": "<string>", "memory_strategy": { "params": { "k": 2 }, "name": "last_k" }, "model_parameters": { "temperature": 0.2 }, "instructions": "You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.", "chat_template": "<string>", "stream": false}'
import requests
url = "https://api.egp.scale.com/v4/chat-completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"account_id": "<string>",
"memory_strategy": {
"params": { "k": 2 },
"name": "last_k"
},
"model_parameters": { "temperature": 0.2 },
"instructions": "You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.",
"chat_template": "<string>",
"stream": False
}
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({
messages: [{content: '<string>', role: 'user'}],
account_id: '<string>',
memory_strategy: {params: {k: 2}, name: 'last_k'},
model_parameters: {temperature: 0.2},
instructions: 'You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.',
chat_template: '<string>',
stream: false
})
};
fetch('https://api.egp.scale.com/v4/chat-completions', 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.egp.scale.com/v4/chat-completions",
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([
'messages' => [
[
'content' => '<string>',
'role' => 'user'
]
],
'account_id' => '<string>',
'memory_strategy' => [
'params' => [
'k' => 2
],
'name' => 'last_k'
],
'model_parameters' => [
'temperature' => 0.2
],
'instructions' => 'You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.',
'chat_template' => '<string>',
'stream' => false
]),
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.egp.scale.com/v4/chat-completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}")
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.egp.scale.com/v4/chat-completions")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/chat-completions")
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 = "{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body
Given a list of messages representing a conversation history, runs LLM inference to produce the next message.
Details
Like completions, chat completions involve an LLM’s response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account.
Messages
The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object.
Each message object is attributed to a specific entity through its role. The available roles are:
user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant.
When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user’s query. When the role is assistant, content is the model’s response to the user. When the role is system, content represents the instruction for the assistant.
Instructions
You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.
POST
/
v4
/
chat-completions
Create Chat Completion
curl --request POST \ --url https://api.egp.scale.com/v4/chat-completions \ --header 'Content-Type: application/json' \ --data '{ "messages": [ { "content": "<string>", "role": "user" } ], "account_id": "<string>", "memory_strategy": { "params": { "k": 2 }, "name": "last_k" }, "model_parameters": { "temperature": 0.2 }, "instructions": "You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.", "chat_template": "<string>", "stream": false}'
import requests
url = "https://api.egp.scale.com/v4/chat-completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"account_id": "<string>",
"memory_strategy": {
"params": { "k": 2 },
"name": "last_k"
},
"model_parameters": { "temperature": 0.2 },
"instructions": "You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.",
"chat_template": "<string>",
"stream": False
}
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({
messages: [{content: '<string>', role: 'user'}],
account_id: '<string>',
memory_strategy: {params: {k: 2}, name: 'last_k'},
model_parameters: {temperature: 0.2},
instructions: 'You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.',
chat_template: '<string>',
stream: false
})
};
fetch('https://api.egp.scale.com/v4/chat-completions', 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.egp.scale.com/v4/chat-completions",
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([
'messages' => [
[
'content' => '<string>',
'role' => 'user'
]
],
'account_id' => '<string>',
'memory_strategy' => [
'params' => [
'k' => 2
],
'name' => 'last_k'
],
'model_parameters' => [
'temperature' => 0.2
],
'instructions' => 'You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.',
'chat_template' => '<string>',
'stream' => false
]),
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.egp.scale.com/v4/chat-completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}")
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.egp.scale.com/v4/chat-completions")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/chat-completions")
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 = "{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"account_id\": \"<string>\",\n \"memory_strategy\": {\n \"params\": {\n \"k\": 2\n },\n \"name\": \"last_k\"\n },\n \"model_parameters\": {\n \"temperature\": 0.2\n },\n \"instructions\": \"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.\",\n \"chat_template\": \"<string>\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body
Expand each message type to see how it works and when to use it. Most conversations should begin with a single user message.
User Message
Assistant Message
System Message
Show child attributes
account_id
string | null
The account ID to use for usage tracking. This will be gradually enforced.
memory_strategy
MemoryStrategy · object | null
The memory strategy to use for the agent. A memory strategy is a way to prevent the underlying LLM's context limit from being exceeded. Each memory strategy uses a different technique to condense the input message list into a smaller payload for the underlying LLM.
We only support the Last K memory strategy right now, but will be adding new strategies soon.
Show child attributes
model_parameters
ModelParameters · object | null
Configuration parameters for the chat completion model, such as temperature, max_tokens, and stop_sequences.
If not specified, the default value are:
temperature: 0.2
max_tokens: None (limited by the model's max tokens)
stop_sequences: None
Show child attributes
instructions
string | null
default:You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.
The initial instructions to provide to the chat completion model.
Use this to guide the model to act in more specific ways. For example, if you have specific rules you want to restrict the model to follow you can specify them here.
Good prompt engineering is crucial to getting performant results from the model. If you are having trouble getting the model to perform well, try writing more specific instructions here before trying more expensive techniques such as swapping in other models or finetuning the underlying LLM.
chat_template
string | null
Currently only supported for LLM-Engine models. A Jinja template string that defines how the chat completion API formats the string prompt. For Llama models, the template must take in at most a messages object, bos_token string, and eos_token string. The messages object is a list of dictionaries, each with keys role and content. For Mixtral models, the template must take in at most a messages object and eos_token string. The messages object looks identical to the Llama model's messages object, but the template can assume the role key takes on the values user or assistant, or system for the first message. The chat template either needs to handle this system message (which gets set via the instructions field or by the messages), or the instructions field must be set to null and the messages object must not contain any system messages.See the default chat template present in the Llama and Mixtral tokenizers for examples.
stream
boolean
default:false
Whether or not to stream the response.
Setting this to True will stream the completion in real-time.
Response
Successful Response
chat_completion
ChatCompletion · object
required
Show child attributes
token_usage
TokenUsage · object | null
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Scale","description":"Documentation for Scale's GenAI Platform (SGP): building, evaluating, tracing and deploying AI agents, plus document understanding, OCR and inference.","colors":{"primary":"#3f2e7b","light":"#ca62ff","dark":"#3f2e7b"},"logo":{"light":"https://mintcdn.com/scalegp/YkQgtlZ7_jaCP1h0/logo/light.svg?fit=max\u0026auto=format\u0026n=YkQgtlZ7_jaCP1h0\u0026q=85\u0026s=3afcca56833a7bfb1c8bf1eec6176590","dark":"https://mintcdn.com/scalegp/YkQgtlZ7_jaCP1h0/logo/dark.svg?fit=max\u0026auto=format\u0026n=YkQgtlZ7_jaCP1h0\u0026q=85\u0026s=522975ce3d7a84c5946bc7f8a6702767"},"favicon":{"light":"https://mintcdn.com/scalegp/vT4TaGb2QZ2PoL0h/favicon-light.svg?fit=max\u0026auto=format\u0026n=vT4TaGb2QZ2PoL0h\u0026q=85\u0026s=9dcad04e938e90fdf4e9ecb28e5ad9f8","dark":"https://mintcdn.com/scalegp/vT4TaGb2QZ2PoL0h/favicon-dark.svg?fit=max\u0026auto=format\u0026n=vT4TaGb2QZ2PoL0h\u0026q=85\u0026s=f516033dd3f7c77f7f362c4f12a9508c"},"background":{"decoration":"windows"},"footer":{"socials":{"x":"https://x.com/scale_ai","facebook":"https://www.facebook.com/scaleapi","linkedin":"https://www.linkedin.com/company/scaleai"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"scalegp","hasAudioNarration":false,"actualSubdomain":"scalegp","customDomains":["docs.gp.scale.com"],"gitSource":{"type":"github","owner":"scaleapi","repo":"sgp-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0613197aa5199961e7b979","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"API Reference","count":235},{"language":"default","tag":"AgentOps API","count":141},{"language":"default","tag":"Guides","count":132},{"language":"default","tag":"Agentex API","count":60},{"language":"default","tag":"Evaluations","count":56},{"language":"default","tag":"Dex API","count":48},{"language":"default","tag":"Evaluation Datasets","count":34},{"language":"default","tag":"Models","count":32},{"language":"default","tag":"Knowledge Bases","count":31},{"language":"default","tag":"Capabilities","count":27}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"@font-face{font-family:'Aeonik';src:url('https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2');font-weight:normal;font-style:normal;font-display:swap}h1,h2,h3{font-family:'aeonik';letter-spacing:normal!important}"}]}
{"page":{"pagePath":"reference/v4/chat-completions/create-chat-completion","slug":"/reference/v4/chat-completions/create-chat-completion","pageMetadata":{"title":"Create Chat Completion","description":"### Description\nGiven a list of messages representing a conversation history, runs LLM inference to produce the next message.\n\n### Details\nLike [completions](https://scale-egp.readme.io/docs/completions-1), [chat completions]( https://scale-egp.readme.io/docs/chat-completions-intro) involve an LLM's response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account.\n\n### Messages\nThe primary input to the LLM is a list of messages represented by the `messages` array, which forms the conversation. The `messages` array must contain at least one `message` object. \nEach `message` object is attributed to a specific entity through its `role`. The available roles are:\n - `user`: Represents the human querying the model. - `assistant`: Represents the model responding to user. - `system`: Represents a non-user entity that provides information to guide the behavior of the assistant.\n\nWhen the `role` of a `message` is set to `user`, `assistant`, or `system`, the `message` must also contain a `content` field which is a string representing the actual text of the message itself. Semantically, when the `role` is `user`, `content` contains the user's query. When the `role` is `assistant`, `content` is the model's response to the user. When the `role` is `system`, `content` represents the instruction for the assistant.\n\n### Instructions\nYou may provide instructions to the assistant by supplying by supplying `instructions` in the HTTP request body or by specifying a `message` with `role` set to `system` in the `messages` array. By convention, the system message should be the first message in the array. Do **not** specify both an instruction and a system message in the `messages` array.","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/chat-completions","href":"/reference/v4/chat-completions/create-chat-completion","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n h3: \"h3\",\n li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.h3, {\n children: \"Description\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Given a list of messages representing a conversation history, runs LLM inference to produce the next message.\"\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Details\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Like \", _jsx(_components.a, {\n href: \"https://scale-egp.readme.io/docs/completions-1\",\n children: \"completions\"\n }), \", \", _jsx(_components.a, {\n href: \"https://scale-egp.readme.io/docs/chat-completions-intro\",\n children: \"chat completions\"\n }), \" involve an LLM’s response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account.\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Messages\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The primary input to the LLM is a list of messages represented by the \", _jsx(_components.code, {\n children: \"messages\"\n }), \" array, which forms the conversation. The \", _jsx(_components.code, {\n children: \"messages\"\n }), \" array must contain at least one \", _jsx(_components.code, {\n children: \"message\"\n }), \" object.\\nEach \", _jsx(_components.code, {\n children: \"message\"\n }), \" object is attributed to a specific entity through its \", _jsx(_components.code, {\n children: \"role\"\n }), \". The available roles are:\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"user\"\n }), \": Represents the human querying the model. - \", _jsx(_components.code, {\n children: \"assistant\"\n }), \": Represents the model responding to user. - \", _jsx(_components.code, {\n children: \"system\"\n }), \": Represents a non-user entity that provides information to guide the behavior of the assistant.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"When the \", _jsx(_components.code, {\n children: \"role\"\n }), \" of a \", _jsx(_components.code, {\n children: \"message\"\n }), \" is set to \", _jsx(_components.code, {\n children: \"user\"\n }), \", \", _jsx(_components.code, {\n children: \"assistant\"\n }), \", or \", _jsx(_components.code, {\n children: \"system\"\n }), \", the \", _jsx(_components.code, {\n children: \"message\"\n }), \" must also contain a \", _jsx(_components.code, {\n children: \"content\"\n }), \" field which is a string representing the actual text of the message itself. Semantically, when the \", _jsx(_components.code, {\n children: \"role\"\n }), \" is \", _jsx(_components.code, {\n children: \"user\"\n }), \", \", _jsx(_components.code, {\n children: \"content\"\n }), \" contains the user’s query. When the \", _jsx(_components.code, {\n children: \"role\"\n }), \" is \", _jsx(_components.code, {\n children: \"assistant\"\n }), \", \", _jsx(_components.code, {\n children: \"content\"\n }), \" is the model’s response to the user. When the \", _jsx(_components.code, {\n children: \"role\"\n }), \" is \", _jsx(_components.code, {\n children: \"system\"\n }), \", \", _jsx(_components.code, {\n children: \"content\"\n }), \" represents the instruction for the assistant.\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Instructions\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"You may provide instructions to the assistant by supplying by supplying \", _jsx(_components.code, {\n children: \"instructions\"\n }), \" in the HTTP request body or by specifying a \", _jsx(_components.code, {\n children: \"message\"\n }), \" with \", _jsx(_components.code, {\n children: \"role\"\n }), \" set to \", _jsx(_components.code, {\n children: \"system\"\n }), \" in the \", _jsx(_components.code, {\n children: \"messages\"\n }), \" array. By convention, the system message should be the first message in the array. Do \", _jsx(_components.strong, {\n children: \"not\"\n }), \" specify both an instruction and a system message in the \", _jsx(_components.code, {\n children: \"messages\"\n }), \" array.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Chat Completion","description":"### Description\nGiven a list of messages representing a conversation history, runs LLM inference to produce the next message.\n\n### Details\nLike [completions](https://scale-egp.readme.io/docs/completions-1), [chat completions]( https://scale-egp.readme.io/docs/chat-completions-intro) involve an LLM's response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account.\n\n### Messages\nThe primary input to the LLM is a list of messages represented by the `messages` array, which forms the conversation. The `messages` array must contain at least one `message` object. \nEach `message` object is attributed to a specific entity through its `role`. The available roles are:\n - `user`: Represents the human querying the model. - `assistant`: Represents the model responding to user. - `system`: Represents a non-user entity that provides information to guide the behavior of the assistant.\n\nWhen the `role` of a `message` is set to `user`, `assistant`, or `system`, the `message` must also contain a `content` field which is a string representing the actual text of the message itself. Semantically, when the `role` is `user`, `content` contains the user's query. When the `role` is `assistant`, `content` is the model's response to the user. When the `role` is `system`, `content` represents the instruction for the assistant.\n\n### Instructions\nYou may provide instructions to the assistant by supplying by supplying `instructions` in the HTTP request body or by specifying a `message` with `role` set to `system` in the `messages` array. By convention, the system message should be the first message in the array. Do **not** specify both an instruction and a system message in the `messages` array.","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/chat-completions","href":"/reference/v4/chat-completions/create-chat-completion","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat Completions"],"summary":"Create Chat Completion","description":"### Description\nGiven a list of messages representing a conversation history, runs LLM inference to produce the next message.\n\n### Details\nLike [completions](https://scale-egp.readme.io/docs/completions-1), [chat completions]( https://scale-egp.readme.io/docs/chat-completions-intro) involve an LLM's response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account.\n\n### Messages\nThe primary input to the LLM is a list of messages represented by the `messages` array, which forms the conversation. The `messages` array must contain at least one `message` object. \nEach `message` object is attributed to a specific entity through its `role`. The available roles are:\n - `user`: Represents the human querying the model. - `assistant`: Represents the model responding to user. - `system`: Represents a non-user entity that provides information to guide the behavior of the assistant.\n\nWhen the `role` of a `message` is set to `user`, `assistant`, or `system`, the `message` must also contain a `content` field which is a string representing the actual text of the message itself. Semantically, when the `role` is `user`, `content` contains the user's query. When the `role` is `assistant`, `content` is the model's response to the user. When the `role` is `system`, `content` represents the instruction for the assistant.\n\n### Instructions\nYou may provide instructions to the assistant by supplying by supplying `instructions` in the HTTP request body or by specifying a `message` with `role` set to `system` in the `messages` array. By convention, the system message should be the first message in the array. Do **not** specify both an instruction and a system message in the `messages` array.","operationId":"POST-V4-/v2/chat-completions","requestBody":"dd0edb81-04f5-45d5-8b20-568a568e62d3","responses":{"200":"91917e42-1d8a-48f3-abe0-85cb9fe0885a","422":"15ca42dd-c7f9-44d9-a918-ff58ef0e1cdc"},"method":"post","type":"path","servers":["2ac3b6a5-ffa8-41d2-9a9f-393d84b7e308"],"security":[],"path":"/v4/chat-completions","baseUrlOptions":["https://api.egp.scale.com"],"title":"Create Chat Completion","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"model":{"type":"string","enum":["gpt-oss-120b","gpt-oss-20b","o1","o1-mini","o3-mini","gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-4o","gpt-4o-mini","gpt-4o-2024-08-06","gpt-3.5-turbo","gpt-3.5-turbo-0613","gpt-3.5-turbo-16k","gpt-3.5-turbo-16k-0613","gemini-pro","gemini-1.5-pro-001","gemini-1.5-pro-002","gemini-1.5-pro-preview-0409","gemini-1.5-pro-preview-0514","llama-2-7b-chat","llama-2-13b-chat","llama-2-70b-chat","llama-3-8b-instruct","llama-3-70b-instruct","llama-3-1-8b-instruct","llama-3-1-70b-instruct","llama-3-2-1b-instruct","llama-3-2-3b-instruct","llama-3-3-70b-instruct","Meta-Llama-3-8B-Instruct-RMU","Meta-Llama-3-8B-Instruct-RR","Meta-Llama-3-8B-Instruct-DERTA","Meta-Llama-3-8B-Instruct-LAT","mixtral-8x7b-instruct","mixtral-8x22b-instruct","claude-3-opus-20240229","claude-3-sonnet-20240229","claude-3-haiku-20240307","claude-3-5-sonnet-20240620","claude-3-5-sonnet-20241022","phi-3-mini-4k-instruct","phi-3-cat-merged","zephyr-cat-merged","dolphin-2.9-llama3-8b","dolphin-2.9-llama3-70b","defense-llama-3-8b-instruct","donovan-combat-llama","llama3-1-405b-instruct-v1"],"title":"Model","description":"The ID of the model to use for chat completions. We only support the models listed here so far.","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"messages":{"items":{"oneOf":[{"type":"object","title":"User Message","required":["content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Content","description":"Input from the user. Can either be text or a list of content parts. Not all models support image content parts, or multiple parts.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"TextUserMessageContentParts","required":["text"],"properties":{"text":{"type":"string","title":"Text","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","const":"text","title":"Type","default":"text","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"TextUserMessageContentParts · object"},{"type":"object","title":"ImageUrlUserMessageContentParts","required":["image_url"],"properties":{"image_url":{"properties":{"url":{"type":"string","title":"Url","description":"The URL of the image. Note: only OpenAI supports this.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","enum":["low","high","auto"],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring> | null"}},"type":"object","required":["url"],"title":"ImageUrlSubPart","description":"Specifies the image URL and level of detail. Only supported by OpenAI models","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"ImageUrlSubPart · object"},"type":{"type":"string","const":"image_url","title":"Type","default":"image_url","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"ImageUrlUserMessageContentParts · object"},{"type":"object","title":"ImageDataUserMessageContentParts","required":["image_data"],"properties":{"image_data":{"properties":{"media_type":{"type":"string","title":"Media Type","description":"The media/mime type of the image data. For example, 'image/png'. Check providers' documentation for supported media types.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.media_type","typeLabel":"string"},"data":{"type":"string","title":"Data","description":"The base64-encoded image data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.data","typeLabel":"string"},"type":{"type":"string","const":"base64","title":"Type","description":"The type of the image data. Only base64 is supported.","default":"base64","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.type","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","enum":["low","high","auto"],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail","typeLabel":"enum\u003cstring> | null"}},"type":"object","required":["media_type","data"],"title":"ImageDataSubPart","description":"Specifies inline image data","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data","typeLabel":"ImageDataSubPart · object"},"type":{"type":"string","const":"image_data","title":"Type","default":"image_data","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"ImageDataUserMessageContentParts · object"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX]","typeLabel":"TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object"},"title":"Content","description":"Input from the user. Can either be text or a list of content parts. Not all models support image content parts, or multiple parts.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1","typeLabel":"(TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object)[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content","typeLabel":"string | (TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object)[]"},"role":{"type":"string","const":"user","title":"Role","description":"The role of the message. Must be set to 'user'.\n\nA user message is a message from the user to the AI. This should be the message used to send end user input to the AI.","default":"user","uniqueKey":"messages.items.[INDEX].oneOf.0.role","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0","typeLabel":"User Message · object"},{"type":"object","title":"Assistant Message","required":["content"],"properties":{"content":{"type":"string","title":"Content","description":"Text response from the assistant","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content","typeLabel":"string"},"role":{"type":"string","const":"assistant","title":"Role","description":"The role of the message. Must be set to 'assistant'.\n\nAn assistant message is a message from the AI to the client. It is different from an agent message in that it cannot contain a tool request. It is simply a direct response from the AI to the client.","default":"assistant","uniqueKey":"messages.items.[INDEX].oneOf.1.role","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.1","typeLabel":"Assistant Message · object"},{"type":"object","title":"System Message","required":["content"],"properties":{"content":{"type":"string","title":"Content","description":"Text input from the system.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content","typeLabel":"string"},"role":{"type":"string","const":"system","title":"Role","description":"The role of the message. Must be set to 'system'.\n\nA system message is different from other messages in that it does not originate from a party engaged in a user/AI conversation. Instead, it is a message that is injected by either the application or system to guide the conversation. For example, a system message may be used as initial instructions for an AI entity or to tell the AI that it did not do something correctly.","default":"system","uniqueKey":"messages.items.[INDEX].oneOf.2.role","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.2","typeLabel":"System Message · object"}],"uniqueKey":"messages.items.[INDEX]","typeLabel":"User Message · object | Assistant Message · object | System Message · object"},"type":"array","title":"Messages","description":"The list of messages in the conversation.\n\nExpand each message type to see how it works and when to use it. Most conversations should begin with a single `user` message.","isRequired":true,"uniqueKey":"messages","typeLabel":"(User Message · object | Assistant Message · object | System Message · object)[]"},"account_id":{"oneOf":[{"type":"string","title":"Account Id","description":"The account ID to use for usage tracking. This will be gradually enforced.","uniqueKey":"account_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Account Id","description":"The account ID to use for usage tracking. This will be gradually enforced.","uniqueKey":"account_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"account_id","typeLabel":"string | null"},"memory_strategy":{"oneOf":[{"type":"object","title":"MemoryStrategy","description":"The memory strategy to use for the agent. A memory strategy is a way to prevent the underlying LLM's context limit from being exceeded. Each memory strategy uses a different technique to condense the input message list into a smaller payload for the underlying LLM.\n\nWe only support the Last K memory strategy right now, but will be adding new strategies soon.","required":["params"],"properties":{"params":{"properties":{"k":{"type":"integer","minimum":1,"title":"K","description":"The maximum number of previous messages to remember.","isRequired":true,"uniqueKey":"memory_strategy.oneOf.0.params.k","typeLabel":"integer"}},"type":"object","required":["k"],"title":"LastKMemoryStrategyParams","description":"Configuration parameters for the memory strategy.","isRequired":true,"uniqueKey":"memory_strategy.oneOf.0.params","typeLabel":"LastKMemoryStrategyParams · object"},"name":{"type":"string","const":"last_k","title":"Name","description":"Name of the memory strategy. Must be `last_k`.\n\nThis strategy truncates the message history to the last `k` messages. It is the simplest way to prevent the model's context limit from being exceeded. However, this strategy only allows the model to have short term memory. For longer term memory, please use one of the other strategies.","default":"last_k","uniqueKey":"memory_strategy.oneOf.0.name","typeLabel":"string"}},"uniqueKey":"memory_strategy.oneOf.0","typeLabel":"MemoryStrategy · object"},{"type":"null","description":"The memory strategy to use for the agent. A memory strategy is a way to prevent the underlying LLM's context limit from being exceeded. Each memory strategy uses a different technique to condense the input message list into a smaller payload for the underlying LLM.\n\nWe only support the Last K memory strategy right now, but will be adding new strategies soon.","uniqueKey":"memory_strategy.oneOf.1","typeLabel":"null"}],"uniqueKey":"memory_strategy","typeLabel":"MemoryStrategy · object | null"},"model_parameters":{"oneOf":[{"type":"object","title":"ModelParameters","description":"Configuration parameters for the chat completion model, such as temperature, max_tokens, and stop_sequences.\n\nIf not specified, the default value are:\n- temperature: 0.2\n- max_tokens: None (limited by the model's max tokens)\n- stop_sequences: None","default":{"temperature":0.2},"properties":{"temperature":{"oneOf":[{"type":"number","title":"Temperature","description":"What sampling temperature to use, between [0, 1]. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Setting temperature=0.0 will enable fully deterministic (greedy) sampling. Temperature is ignored for OpenAI reasoning models.","default":0.2,"maximum":1,"minimum":0,"uniqueKey":"model_parameters.oneOf.0.temperature.oneOf.0","typeLabel":"number"},{"type":"null","title":"Temperature","description":"What sampling temperature to use, between [0, 1]. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Setting temperature=0.0 will enable fully deterministic (greedy) sampling. Temperature is ignored for OpenAI reasoning models.","default":0.2,"uniqueKey":"model_parameters.oneOf.0.temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.temperature","typeLabel":"number | null"},"stop_sequences":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"model_parameters.oneOf.0.stop_sequences.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Stop Sequences","description":"List of up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.","maxItems":4,"uniqueKey":"model_parameters.oneOf.0.stop_sequences.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Stop Sequences","description":"List of up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.","uniqueKey":"model_parameters.oneOf.0.stop_sequences.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.stop_sequences","typeLabel":"string[] | null"},"max_tokens":{"oneOf":[{"type":"integer","title":"Max Tokens","description":"The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. If not, specified, max_tokens will be determined based on the model used: \n| Model API family | Model API default | EGP applied default |\n| --- | --- | --- |\n| OpenAI Completions | [`16`](https://platform.openai.com/docs/api-reference/completions/create#max_tokens) | `context window - prompt size` |\n| OpenAI Chat Completions | [`context window - prompt size`](https://platform.openai.com/docs/api-reference/chat/create#max_tokens) | `context window - prompt size` |\n| LLM Engine | [`max_new_tokens`](https://github.com/scaleapi/launch-python-client/blob/207adced1c88c1c2907266fa9dd1f1ff3ec0ea5b/launch/client.py#L2910) parameter is required | `100` |\n| Anthropic Claude 2 | [`max_tokens_to_sample`](https://docs.anthropic.com/claude/reference/complete_post) parameter is required | `10000` |\n","uniqueKey":"model_parameters.oneOf.0.max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Max Tokens","description":"The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. If not, specified, max_tokens will be determined based on the model used: \n| Model API family | Model API default | EGP applied default |\n| --- | --- | --- |\n| OpenAI Completions | [`16`](https://platform.openai.com/docs/api-reference/completions/create#max_tokens) | `context window - prompt size` |\n| OpenAI Chat Completions | [`context window - prompt size`](https://platform.openai.com/docs/api-reference/chat/create#max_tokens) | `context window - prompt size` |\n| LLM Engine | [`max_new_tokens`](https://github.com/scaleapi/launch-python-client/blob/207adced1c88c1c2907266fa9dd1f1ff3ec0ea5b/launch/client.py#L2910) parameter is required | `100` |\n| Anthropic Claude 2 | [`max_tokens_to_sample`](https://docs.anthropic.com/claude/reference/complete_post) parameter is required | `10000` |\n","uniqueKey":"model_parameters.oneOf.0.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.max_tokens","typeLabel":"integer | null"},"topP":{"oneOf":[{"type":"number","title":"Topp","description":"The cumulative probability cutoff for token selection. Lower values mean sampling from a smaller, more top-weighted nucleus. Available for models from Anthropic, Google, LLM Engine, and OpenAI.","uniqueKey":"model_parameters.oneOf.0.topP.oneOf.0","typeLabel":"number"},{"type":"null","title":"Topp","description":"The cumulative probability cutoff for token selection. Lower values mean sampling from a smaller, more top-weighted nucleus. Available for models from Anthropic, Google, LLM Engine, and OpenAI.","uniqueKey":"model_parameters.oneOf.0.topP.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.topP","typeLabel":"number | null"},"topK":{"oneOf":[{"type":"integer","title":"Topk","description":"Sample from the k most likely next tokens at each step. Lower k focuses on higher probability tokens. Available for models from Anthropic, Google, and LLM Engine.","uniqueKey":"model_parameters.oneOf.0.topK.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Topk","description":"Sample from the k most likely next tokens at each step. Lower k focuses on higher probability tokens. Available for models from Anthropic, Google, and LLM Engine.","uniqueKey":"model_parameters.oneOf.0.topK.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.topK","typeLabel":"integer | null"},"frequency_penalty":{"oneOf":[{"type":"number","title":"Frequency Penalty","description":"Penalize tokens based on how much they have already appeared in the text. Positive values encourage the model to generate new tokens and negative values encourage the model to repeat tokens. Available for models from LLM Engine, and OpenAI","uniqueKey":"model_parameters.oneOf.0.frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","title":"Frequency Penalty","description":"Penalize tokens based on how much they have already appeared in the text. Positive values encourage the model to generate new tokens and negative values encourage the model to repeat tokens. Available for models from LLM Engine, and OpenAI","uniqueKey":"model_parameters.oneOf.0.frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.frequency_penalty","typeLabel":"number | null"},"presence_penalty":{"oneOf":[{"type":"number","title":"Presence Penalty","description":"Penalize tokens based on if they have already appeared in the text. Positive values encourage the model to generate new tokens and negative values encourage the model to repeat tokens. Available for models from LLM Engine, and OpenAI.","uniqueKey":"model_parameters.oneOf.0.presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","title":"Presence Penalty","description":"Penalize tokens based on if they have already appeared in the text. Positive values encourage the model to generate new tokens and negative values encourage the model to repeat tokens. Available for models from LLM Engine, and OpenAI.","uniqueKey":"model_parameters.oneOf.0.presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.presence_penalty","typeLabel":"number | null"},"reasoning_effort":{"oneOf":[{"type":"string","title":"Reasoning Effort","description":"The effort level for the model to reason. Available for models from OpenAI.","enum":["low","medium","high"],"uniqueKey":"model_parameters.oneOf.0.reasoning_effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Reasoning Effort","description":"The effort level for the model to reason. Available for models from OpenAI.","uniqueKey":"model_parameters.oneOf.0.reasoning_effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters.oneOf.0.reasoning_effort","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"model_parameters.oneOf.0","typeLabel":"ModelParameters · object"},{"type":"null","description":"Configuration parameters for the chat completion model, such as temperature, max_tokens, and stop_sequences.\n\nIf not specified, the default value are:\n- temperature: 0.2\n- max_tokens: None (limited by the model's max tokens)\n- stop_sequences: None","default":{"temperature":0.2},"uniqueKey":"model_parameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"model_parameters","typeLabel":"ModelParameters · object | null"},"instructions":{"oneOf":[{"type":"string","title":"Instructions","description":"The initial instructions to provide to the chat completion model.\n\nUse this to guide the model to act in more specific ways. For example, if you have specific rules you want to restrict the model to follow you can specify them here.\n\nGood prompt engineering is crucial to getting performant results from the model. If you are having trouble getting the model to perform well, try writing more specific instructions here before trying more expensive techniques such as swapping in other models or finetuning the underlying LLM.","default":"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.","uniqueKey":"instructions.oneOf.0","typeLabel":"string"},{"type":"null","title":"Instructions","description":"The initial instructions to provide to the chat completion model.\n\nUse this to guide the model to act in more specific ways. For example, if you have specific rules you want to restrict the model to follow you can specify them here.\n\nGood prompt engineering is crucial to getting performant results from the model. If you are having trouble getting the model to perform well, try writing more specific instructions here before trying more expensive techniques such as swapping in other models or finetuning the underlying LLM.","default":"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.","uniqueKey":"instructions.oneOf.1","typeLabel":"null"}],"uniqueKey":"instructions","typeLabel":"string | null"},"chat_template":{"oneOf":[{"type":"string","title":"Chat Template","description":"Currently only supported for LLM-Engine models. A Jinja template string that defines how the chat completion API formats the string prompt. For Llama models, the template must take in at most a `messages` object, `bos_token` string, and `eos_token` string. The `messages` object is a list of dictionaries, each with keys `role` and `content`. For Mixtral models, the template must take in at most a `messages` object and `eos_token` string. The `messages` object looks identical to the Llama model's `messages` object, but the template can assume the `role` key takes on the values `user` or `assistant`, or `system` for the first message. The chat template either needs to handle this system message (which gets set via the `instructions` field or by the messages), or the `instructions` field must be set to `null` and the `messages` object must not contain any system messages.See the default chat template present in the Llama and Mixtral tokenizers for examples.","uniqueKey":"chat_template.oneOf.0","typeLabel":"string"},{"type":"null","title":"Chat Template","description":"Currently only supported for LLM-Engine models. A Jinja template string that defines how the chat completion API formats the string prompt. For Llama models, the template must take in at most a `messages` object, `bos_token` string, and `eos_token` string. The `messages` object is a list of dictionaries, each with keys `role` and `content`. For Mixtral models, the template must take in at most a `messages` object and `eos_token` string. The `messages` object looks identical to the Llama model's `messages` object, but the template can assume the `role` key takes on the values `user` or `assistant`, or `system` for the first message. The chat template either needs to handle this system message (which gets set via the `instructions` field or by the messages), or the `instructions` field must be set to `null` and the `messages` object must not contain any system messages.See the default chat template present in the Llama and Mixtral tokenizers for examples.","uniqueKey":"chat_template.oneOf.1","typeLabel":"null"}],"uniqueKey":"chat_template","typeLabel":"string | null"},"stream":{"type":"boolean","title":"Stream","description":"Whether or not to stream the response.\n\nSetting this to True will stream the completion in real-time.","default":false,"uniqueKey":"stream","typeLabel":"boolean"}},"type":"object","required":["model","messages"],"title":"CreateChatCompletionRequest","uniqueKey":"","typeLabel":"CreateChatCompletionRequest · object"},"examples":{"Example":{"title":"Example","value":{"messages":[{"content":"\u003cstring>","role":"user"}],"account_id":"\u003cstring>","memory_strategy":{"params":{"k":2},"name":"last_k"},"model_parameters":{"temperature":0.2},"instructions":"You are an AI assistant that helps users with their questions by chatting back and forth with them. When asked a question, you should answer it as best as you can with the information you have. If you need more information, you can ask the user for it.","chat_template":"\u003cstring>","stream":false}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"91917e42-1d8a-48f3-abe0-85cb9fe0885a":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"chat_completion":{"properties":{"message":{"oneOf":[{"type":"object","title":"User Message","required":["content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Content","description":"Input from the user. Can either be text or a list of content parts. Not all models support image content parts, or multiple parts.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"TextUserMessageContentParts","required":["text"],"properties":{"text":{"type":"string","title":"Text","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","const":"text","title":"Type","default":"text","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"TextUserMessageContentParts · object"},{"type":"object","title":"ImageUrlUserMessageContentParts","required":["image_url"],"properties":{"image_url":{"properties":{"url":{"type":"string","title":"Url","description":"The URL of the image. Note: only OpenAI supports this.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","enum":["low","high","auto"],"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring> | null"}},"type":"object","required":["url"],"title":"ImageUrlSubPart","description":"Specifies the image URL and level of detail. Only supported by OpenAI models","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"ImageUrlSubPart · object"},"type":{"type":"string","const":"image_url","title":"Type","default":"image_url","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"ImageUrlUserMessageContentParts · object"},{"type":"object","title":"ImageDataUserMessageContentParts","required":["image_data"],"properties":{"image_data":{"properties":{"media_type":{"type":"string","title":"Media Type","description":"The media/mime type of the image data. For example, 'image/png'. Check providers' documentation for supported media types.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.media_type","typeLabel":"string"},"data":{"type":"string","title":"Data","description":"The base64-encoded image data.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.data","typeLabel":"string"},"type":{"type":"string","const":"base64","title":"Type","description":"The type of the image data. Only base64 is supported.","default":"base64","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.type","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","enum":["low","high","auto"],"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Detail","description":"Only used for OpenAI. Corresponds to OpenAI's image detail parameter.","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data.detail","typeLabel":"enum\u003cstring> | null"}},"type":"object","required":["media_type","data"],"title":"ImageDataSubPart","description":"Specifies inline image data","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.image_data","typeLabel":"ImageDataSubPart · object"},"type":{"type":"string","const":"image_data","title":"Type","default":"image_data","uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"string"}},"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"ImageDataUserMessageContentParts · object"}],"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1.items.[INDEX]","typeLabel":"TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object"},"title":"Content","description":"Input from the user. Can either be text or a list of content parts. Not all models support image content parts, or multiple parts.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content.oneOf.1","typeLabel":"(TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object)[]"}],"isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0.content","typeLabel":"string | (TextUserMessageContentParts · object | ImageUrlUserMessageContentParts · object | ImageDataUserMessageContentParts · object)[]"},"role":{"type":"string","const":"user","title":"Role","description":"The role of the message. Must be set to 'user'.\n\nA user message is a message from the user to the AI. This should be the message used to send end user input to the AI.","default":"user","uniqueKey":"chat_completion.message.oneOf.0.role","typeLabel":"string"}},"isRequired":true,"uniqueKey":"chat_completion.message.oneOf.0","typeLabel":"User Message · object"},{"type":"object","title":"Assistant Message","required":["content"],"properties":{"content":{"type":"string","title":"Content","description":"Text response from the assistant","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.1.content","typeLabel":"string"},"role":{"type":"string","const":"assistant","title":"Role","description":"The role of the message. Must be set to 'assistant'.\n\nAn assistant message is a message from the AI to the client. It is different from an agent message in that it cannot contain a tool request. It is simply a direct response from the AI to the client.","default":"assistant","uniqueKey":"chat_completion.message.oneOf.1.role","typeLabel":"string"}},"isRequired":true,"uniqueKey":"chat_completion.message.oneOf.1","typeLabel":"Assistant Message · object"},{"type":"object","title":"System Message","required":["content"],"properties":{"content":{"type":"string","title":"Content","description":"Text input from the system.","isRequired":true,"uniqueKey":"chat_completion.message.oneOf.2.content","typeLabel":"string"},"role":{"type":"string","const":"system","title":"Role","description":"The role of the message. Must be set to 'system'.\n\nA system message is different from other messages in that it does not originate from a party engaged in a user/AI conversation. Instead, it is a message that is injected by either the application or system to guide the conversation. For example, a system message may be used as initial instructions for an AI entity or to tell the AI that it did not do something correctly.","default":"system","uniqueKey":"chat_completion.message.oneOf.2.role","typeLabel":"string"}},"isRequired":true,"uniqueKey":"chat_completion.message.oneOf.2","typeLabel":"System Message · object"}],"isRequired":true,"uniqueKey":"chat_completion.message","typeLabel":"User Message · object | Assistant Message · object | System Message · object"},"finish_reason":{"oneOf":[{"type":"string","title":"Finish Reason","uniqueKey":"chat_completion.finish_reason.oneOf.0","typeLabel":"string"},{"type":"null","title":"Finish Reason","uniqueKey":"chat_completion.finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"chat_completion.finish_reason","typeLabel":"string | null"}},"type":"object","required":["message"],"title":"ChatCompletion","isRequired":true,"uniqueKey":"chat_completion","typeLabel":"ChatCompletion · object"},"token_usage":{"oneOf":[{"type":"object","title":"TokenUsage","required":["total"],"properties":{"total":{"type":"integer","title":"Total","description":"Total number of tokens in both the prompt and the completion.","isRequired":true,"uniqueKey":"token_usage.oneOf.0.total","typeLabel":"integer"},"prompt":{"oneOf":[{"type":"integer","title":"Prompt","description":"Number of tokens in the prompt.","uniqueKey":"token_usage.oneOf.0.prompt.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Prompt","description":"Number of tokens in the prompt.","uniqueKey":"token_usage.oneOf.0.prompt.oneOf.1","typeLabel":"null"}],"uniqueKey":"token_usage.oneOf.0.prompt","typeLabel":"integer | null"},"completion":{"oneOf":[{"type":"integer","title":"Completion","description":"Number of tokens in the completion.","uniqueKey":"token_usage.oneOf.0.completion.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Completion","description":"Number of tokens in the completion.","uniqueKey":"token_usage.oneOf.0.completion.oneOf.1","typeLabel":"null"}],"uniqueKey":"token_usage.oneOf.0.completion","typeLabel":"integer | null"}},"uniqueKey":"token_usage.oneOf.0","typeLabel":"TokenUsage · object"},{"type":"null","uniqueKey":"token_usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"token_usage","typeLabel":"TokenUsage · object | null"}},"type":"object","required":["chat_completion"],"title":"CreateChatCompletionResponse","uniqueKey":"","typeLabel":"CreateChatCompletionResponse · object"},"examples":{"Example":{"title":"Example","value":{"chat_completion":{"message":{"content":"\u003cstring>","role":"user"},"finish_reason":"\u003cstring>"},"token_usage":{"total":123,"prompt":123,"completion":123}}}},"exampleType":"generated"}},"exampleType":"generated"},"15ca42dd-c7f9-44d9-a918-ff58ef0e1cdc":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"type":"object","title":"Context","additionalProperties":true,"uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Context · object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","input":"\u003cunknown>","ctx":{}}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{"2ac3b6a5-ffa8-41d2-9a9f-393d84b7e308":{"url":"https://api.egp.scale.com"}}},"originalFileLocation":"openapi/v4.yaml"},"subdomain":"scalegp","siteName":"Scale","title":"Create Chat Completion - Scale","navMaps":{"firstHrefInVersion":{"V5":{"href":"/docs/v5/overview","matchLevel":4},"V4 (legacy)":{"href":"/reference/v4/chat-completions/create-chat-completion","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-11-23T20:26:53.331Z","originalFileLocation":"reference/v4/chat-completions/create-chat-completion.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"### Description Given a list of messages representing a conversation history, runs LLM inference to produce the next message. ### Details Like completions, chat completions involve an LLM\u0026#x27;s response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account. ### Messages The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object. Each message object is attributed to a specific entity through its role. The available roles are: - user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant. When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user\u0026#x27;s query. When the role is assistant, content is the model\u0026#x27;s response to the user. When the role is system, content represents the instruction for the assistant. ### Instructions You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Scale\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Chat Completion - Scale\">\u003cmeta data-mint-head property=\"og:description\" content=\"### Description Given a list of messages representing a conversation history, runs LLM inference to produce the next message. ### Details Like completions, chat completions involve an LLM\u0026#x27;s response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account. ### Messages The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object. Each message object is attributed to a specific entity through its role. The available roles are: - user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant. When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user\u0026#x27;s query. When the role is assistant, content is the model\u0026#x27;s response to the user. When the role is system, content represents the instruction for the assistant. ### Instructions You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Scale\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://scalegp.mintlify.site/_mintlify/api/og/v2?division=Chat+Completions\u0026amp;title=Create+Chat+Completion\u0026amp;description=%23%23%23+Description%0AGiven+a+list+of+messages+representing+a+conversation+history%2C+runs+LLM+inference+to+produce+++++++++the+next+message.%0A%0A%23%23%23+Details%0ALike+%5Bcomplet\u0026amp;theme=4eb366a505141b7fa10bcb74\u0026amp;signature=f1c8cbbe0af10821eb5747cff530335efa1bc57c9020d1c2419f39bf0d1cb98c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Chat Completion - Scale\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"### Description Given a list of messages representing a conversation history, runs LLM inference to produce the next message. ### Details Like completions, chat completions involve an LLM\u0026#x27;s response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account. ### Messages The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object. Each message object is attributed to a specific entity through its role. The available roles are: - user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant. When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user\u0026#x27;s query. When the role is assistant, content is the model\u0026#x27;s response to the user. When the role is system, content represents the instruction for the assistant. ### Instructions You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://scalegp.mintlify.site/_mintlify/api/og/v2?division=Chat+Completions\u0026amp;title=Create+Chat+Completion\u0026amp;description=%23%23%23+Description%0AGiven+a+list+of+messages+representing+a+conversation+history%2C+runs+LLM+inference+to+produce+++++++++the+next+message.%0A%0A%23%23%23+Details%0ALike+%5Bcomplet\u0026amp;theme=4eb366a505141b7fa10bcb74\u0026amp;signature=f1c8cbbe0af10821eb5747cff530335efa1bc57c9020d1c2419f39bf0d1cb98c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/scalegp/KjwNgkAP0XyDRKtA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Scale\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3f2e7b\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/v4/chat-completions/create-chat-completion.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gp.scale.com/#organization\",\"name\":\"Scale\",\"url\":\"https://docs.gp.scale.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/scalegp/YkQgtlZ7_jaCP1h0/logo/light.svg?fit=max\u0026auto=format\u0026n=YkQgtlZ7_jaCP1h0\u0026q=85\u0026s=3afcca56833a7bfb1c8bf1eec6176590\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gp.scale.com#website\",\"name\":\"Scale\",\"url\":\"https://docs.gp.scale.com\",\"publisher\":{\"@id\":\"https://docs.gp.scale.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion#webpage\",\"url\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion\",\"name\":\"Create Chat Completion\",\"description\":\"### Description Given a list of messages representing a conversation history, runs LLM inference to produce the next message. ### Details Like completions, chat completions involve an LLM's response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account. ### Messages The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object. Each message object is attributed to a specific entity through its role. The available roles are: - user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant. When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user's query. When the role is assistant, content is the model's response to the user. When the role is system, content represents the instruction for the assistant. ### Instructions You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.\",\"dateModified\":\"2026-11-23T20:26:53.331Z\",\"isPartOf\":{\"@id\":\"https://docs.gp.scale.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Scale\",\"item\":\"https://docs.gp.scale.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Chat Completion\",\"item\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion#apireference\",\"headline\":\"Create Chat Completion\",\"name\":\"Create Chat Completion\",\"description\":\"### Description Given a list of messages representing a conversation history, runs LLM inference to produce the next message. ### Details Like completions, chat completions involve an LLM's response to input. However, chat completions take a conversation history as input, instead of a single prompt, which enables the LLM to create responses that take past context into account. ### Messages The primary input to the LLM is a list of messages represented by the messages array, which forms the conversation. The messages array must contain at least one message object. Each message object is attributed to a specific entity through its role. The available roles are: - user: Represents the human querying the model. - assistant: Represents the model responding to user. - system: Represents a non-user entity that provides information to guide the behavior of the assistant. When the role of a message is set to user, assistant, or system, the message must also contain a content field which is a string representing the actual text of the message itself. Semantically, when the role is user, content contains the user's query. When the role is assistant, content is the model's response to the user. When the role is system, content represents the instruction for the assistant. ### Instructions You may provide instructions to the assistant by supplying by supplying instructions in the HTTP request body or by specifying a message with role set to system in the messages array. By convention, the system message should be the first message in the array. Do not specify both an instruction and a system message in the messages array.\",\"url\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gp.scale.com/reference/v4/chat-completions/create-chat-completion#webpage\"},\"dateModified\":\"2026-11-23T20:26:53.331Z\",\"publisher\":{\"@id\":\"https://docs.gp.scale.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gp.scale.com#website\"}}]}\u003c/script>","agentPointerHref":"/reference/v4/chat-completions/create-chat-completion.md","siteName":"Scale","nav":{"global":null,"versions":[{"version":"V5","pages":[{"title":"V5","href":"/docs/v5/overview"}]},{"version":"V4 (legacy)","tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/home"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/docs/introduction"}]},{"tab":"API Reference","groups":[{"group":"Knowledge Bases","pages":[{"title":"List Knowledge Bases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases","href":"/reference/v4/knowledge-bases/list-knowledge-bases"},{"title":"Create Knowledge Base","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases","href":"/reference/v4/knowledge-bases/create-knowledge-base"},{"title":"Get Knowledge Base","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}","href":"/reference/v4/knowledge-bases/get-knowledge-base"},{"title":"Delete Knowledge Base","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/knowledge-bases/{knowledge_base_id}","href":"/reference/v4/knowledge-bases/delete-knowledge-base"},{"title":"Patch Knowledge Base","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/knowledge-bases/{knowledge_base_id}","href":"/reference/v4/knowledge-bases/patch-knowledge-base"},{"title":"List Knowledge Base Async Jobs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/async-jobs","href":"/reference/v4/knowledge-bases/list-knowledge-base-async-jobs"},{"title":"Fetch Chunks by ID or Metadata","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/chunks","href":"/reference/v4/knowledge-bases/fetch-chunks-by-id-or-metadata"},{"title":"Query Relevant Chunks","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/query","href":"/reference/v4/knowledge-bases/query-relevant-chunks"},{"title":"Delete Data Source Connection","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/data-source-connections/{knowledge_base_data_source_id}/delete","href":"/reference/v4/knowledge-bases/delete-data-source-connection"},{"title":"Submit Upload Job with local files","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/upload_files","href":"/reference/v4/knowledge-bases/submit-upload-job-with-local-files"},{"title":"List Upload Jobs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/uploads","href":"/reference/v4/knowledge-bases/list-upload-jobs"},{"title":"Submit Upload Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/uploads","href":"/reference/v4/knowledge-bases/submit-upload-job"},{"title":"Get Upload Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/uploads/{upload_id}","href":"/reference/v4/knowledge-bases/get-upload-job"},{"title":"Cancel Upload Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/uploads/{upload_id}/cancel","href":"/reference/v4/knowledge-bases/cancel-upload-job"},{"title":"List Tracked Artifacts","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/artifacts","href":"/reference/v4/knowledge-bases/list-tracked-artifacts"},{"title":"Get Tracked Artifact Details","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}","href":"/reference/v4/knowledge-bases/get-tracked-artifact-details"},{"title":"Delete Locally Stored Artifact","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}","href":"/reference/v4/knowledge-bases/delete-locally-stored-artifact"},{"title":"Patch Artifact Information","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}","href":"/reference/v4/knowledge-bases/patch-artifact-information"},{"title":"List Chunks of Artifacts with Pagination","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks","href":"/reference/v4/knowledge-bases/list-chunks-of-artifacts-with-pagination"},{"title":"Create chunk for local chunk artifacts","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks","href":"/reference/v4/knowledge-bases/create-chunk-for-local-chunk-artifacts"},{"title":"Get Single Chunk Information and status","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks/{chunk_id}","href":"/reference/v4/knowledge-bases/get-single-chunk-information-and-status"},{"title":"Update Single Chunk data for local artifact","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml put /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks/{chunk_id}","href":"/reference/v4/knowledge-bases/update-single-chunk-data-for-local-artifact"},{"title":"Delete Single Chunk from Local Artifact","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/knowledge-bases/{knowledge_base_id}/artifacts/{artifact_id}/chunks/{chunk_id}","href":"/reference/v4/knowledge-bases/delete-single-chunk-from-local-artifact"},{"title":"Get Chunk and Artifact Information by Chunk ID","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/chunks/{chunk_id}","href":"/reference/v4/knowledge-bases/get-chunk-and-artifact-information-by-chunk-id"},{"title":"Test Knowledge Base Data Source credentials","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-base-data-sources/{knowledge_base_data_source_id}/verify","href":"/reference/v4/knowledge-bases/test-knowledge-base-data-source-credentials"},{"title":"Batch Delete Locally Stored Artifacts","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/artifacts/batch-delete","href":"/reference/v4/knowledge-bases/batch-delete-locally-stored-artifacts"},{"title":"List Upload Schedules","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/upload-schedules","href":"/reference/v4/knowledge-bases/list-upload-schedules"},{"title":"Create Upload Schedule","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-bases/{knowledge_base_id}/upload-schedules","href":"/reference/v4/knowledge-bases/create-upload-schedule"},{"title":"Get Upload Schedule","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}","href":"/reference/v4/knowledge-bases/get-upload-schedule"},{"title":"Delete Upload Schedule","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}","href":"/reference/v4/knowledge-bases/delete-upload-schedule"},{"title":"Update Upload Schedule","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/knowledge-bases/{knowledge_base_id}/upload-schedules/{upload_schedule_id}","href":"/reference/v4/knowledge-bases/update-upload-schedule"}]},{"group":"Chunks","pages":[{"title":"Rank Chunks","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/chunks/rank","href":"/reference/v4/chunks/rank-chunks"}]},{"group":"Agents","pages":[{"title":"Execute Agent","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/agents/execute","href":"/reference/v4/agents/execute-agent"}]},{"group":"Completions","pages":[{"title":"Create Completion","description":"### Description\nGiven a user's input, runs LLM inference to produce the model's response.\n\n### Details\nLLM [completions](https://scale-egp.readme.io/docs/completions-1) have many use cases, such as content summarization, question-answering, and text generation.\n\nThe `model` parameter determines which LLM will be used to generate the completion. Keep in mind that different models have varying sizes, costs, and may perform differently across different tasks.\n\nThe user input, commonly referred to as the \"prompt\", is a required field in the request body. The quality of the model's response can vary greatly depending on the input prompt. Good prompt engineering can significantly enhance the response quality. If you encounter suboptimal results, consider writing more specific instructions or providing examples to the LLM before trying more expensive techniques such as swapping in other models or finetuning.\n\nBy default, the endpoint will return the entire response as one whole object. If you would prefer to stream the completion in real-time, you can achieve this by setting the `stream` flag to `true`.","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/completions","href":"/reference/v4/completions/create-completion"}]},{"group":"Chat Completions","pages":[{"title":"Create Chat Completion","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/chat-completions","href":"/reference/v4/chat-completions/create-chat-completion"}]},{"group":"Models","pages":[{"title":"Execute Model Deployment","description":null,"deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_instance_id}/deployments/{model_deployment_id}/execute","href":"/reference/v4/models/execute-model-deployment"},{"title":"Execute Model Deployment Async and Return the Async Run ID","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_instance_id}/deployments/{model_deployment_id}/executeAsync","href":"/reference/v4/models/execute-model-deployment-async-and-return-the-async-run-id"},{"title":"Poll Async Inference for result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models/{model_instance_id}/deployments/{model_deployment_id}/pollAsync/{async_task_id}","href":"/reference/v4/models/poll-async-inference-for-result"},{"title":"Generate text embedding","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_deployment_id}/embeddings","href":"/reference/v4/models/generate-text-embedding"},{"title":"Generate reranking","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_deployment_id}/rerankings","href":"/reference/v4/models/generate-reranking"},{"title":"Generate completion","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_deployment_id}/completions","href":"/reference/v4/models/generate-completion"},{"title":"Generate chat completion","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_deployment_id}/chat-completions","href":"/reference/v4/models/generate-chat-completion"},{"title":"List Model Deployments of a Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models/{model_instance_id}/deployments","href":"/reference/v4/models/list-model-deployments-of-a-model"},{"title":"Deploy Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models/{model_instance_id}/deployments","href":"/reference/v4/models/deploy-model"},{"title":"Get Model usage by model name","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models/{model_name}/usage-statistics","href":"/reference/v4/models/get-model-usage-by-model-name"},{"title":"List All Model Deployments","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-deployments","href":"/reference/v4/models/list-all-model-deployments"},{"title":"Get Model usage for one deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-deployments/{model_deployment_id}/usage-statistics","href":"/reference/v4/models/get-model-usage-for-one-deployment"},{"title":"Add model to group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/model-groups/{model_group_id}/models/{model_instance_id}","href":"/reference/v4/models/add-model-to-group"},{"title":"Get Model usage for a group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-groups/{model_group_id}/usage-statistics","href":"/reference/v4/models/get-model-usage-for-a-group"},{"title":"List Models","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models","href":"/reference/v4/models/list-models"},{"title":"Create Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/models","href":"/reference/v4/models/create-model"},{"title":"Get Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models/{model_id}","href":"/reference/v4/models/get-model"},{"title":"Delete Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/models/{model_id}","href":"/reference/v4/models/delete-model"},{"title":"Update Model","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/models/{model_id}","href":"/reference/v4/models/update-model"},{"title":"List Model Groups","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-groups","href":"/reference/v4/models/list-model-groups"},{"title":"Create Model Group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/model-groups","href":"/reference/v4/models/create-model-group"},{"title":"Get Model Group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-groups/{model_group_id}","href":"/reference/v4/models/get-model-group"},{"title":"Delete Model Group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/model-groups/{model_group_id}","href":"/reference/v4/models/delete-model-group"},{"title":"Update Model Group","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/model-groups/{model_group_id}","href":"/reference/v4/models/update-model-group"},{"title":"Get Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/models/{model_instance_id}/deployments/{deployment_id}","href":"/reference/v4/models/get-deployment"},{"title":"Delete Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/models/{model_instance_id}/deployments/{deployment_id}","href":"/reference/v4/models/delete-deployment"},{"title":"Update Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/models/{model_instance_id}/deployments/{deployment_id}","href":"/reference/v4/models/update-deployment"}]},{"group":"Users","pages":[{"title":"User info","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /user-info","href":"/reference/v4/users/user-info"},{"title":"Update user info","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /user-preferences","href":"/reference/v4/users/update-user-info"},{"title":"Get User","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /users/{user_id}","href":"/reference/v4/users/get-user"}]},{"group":"Accounts","pages":[{"title":"Create account","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /accounts","href":"/reference/v4/accounts/create-account"}]},{"group":"Organizations","pages":[{"title":"Get organization","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /organizations/by-domain/{domain}","href":"/reference/v4/organizations/get-organization"}]},{"group":"Question Sets","pages":[{"title":"Get Question Set","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/question-sets/{question_set_id}","href":"/reference/v4/question-sets/get-question-set"},{"title":"Delete Question Set","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/question-sets/{question_set_id}","href":"/reference/v4/question-sets/delete-question-set"},{"title":"Update Question Set","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/question-sets/{question_set_id}","href":"/reference/v4/question-sets/update-question-set"},{"title":"List Question Sets","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/question-sets","href":"/reference/v4/question-sets/list-question-sets"},{"title":"Create Question Set","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/question-sets","href":"/reference/v4/question-sets/create-question-set"}]},{"group":"Evaluations","pages":[{"title":"Claim Evaluation Task","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluations/{evaluation_id}/claim-task","href":"/reference/v4/evaluations/claim-evaluation-task"},{"title":"Batch assign tasks to user","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluations/{evaluation_id}/tasks/batch-assign","href":"/reference/v4/evaluations/batch-assign-tasks-to-user"},{"title":"Update Evaluation Task","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluations/{evaluation_id}/tasks/{task_id}","href":"/reference/v4/evaluations/update-evaluation-task"},{"title":"Get Contributor Metrics","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/contributor-metrics/{contributor_id}","href":"/reference/v4/evaluations/get-contributor-metrics"},{"title":"List Contributor Metrics","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/contributor-metrics","href":"/reference/v4/evaluations/list-contributor-metrics"},{"title":"Get Evaluation Metrics","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/evaluation-metrics","href":"/reference/v4/evaluations/get-evaluation-metrics"},{"title":"Get Hybrid Evaluation Metrics","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/hybrid-eval-metrics","href":"/reference/v4/evaluations/get-hybrid-evaluation-metrics"},{"title":"List Evaluations","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations","href":"/reference/v4/evaluations/list-evaluations"},{"title":"Create Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluations","href":"/reference/v4/evaluations/create-evaluation"},{"title":"Get Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}","href":"/reference/v4/evaluations/get-evaluation"},{"title":"Delete Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluations/{evaluation_id}","href":"/reference/v4/evaluations/delete-evaluation"},{"title":"Update Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluations/{evaluation_id}","href":"/reference/v4/evaluations/update-evaluation"},{"title":"List Test Case Results","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/test-case-results","href":"/reference/v4/evaluations/list-test-case-results"},{"title":"Create Test Case Result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluations/{evaluation_id}/test-case-results","href":"/reference/v4/evaluations/create-test-case-result"},{"title":"Batch Create Test Case Results","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluations/{evaluation_id}/test-case-results/batch","href":"/reference/v4/evaluations/batch-create-test-case-results"},{"title":"Get Test Case Result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}","href":"/reference/v4/evaluations/get-test-case-result"},{"title":"Update Test Case Result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}","href":"/reference/v4/evaluations/update-test-case-result"},{"title":"Get Historical Test Case Result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}/history/{num}","href":"/reference/v4/evaluations/get-historical-test-case-result"},{"title":"Get All Versions of Test Case Result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/test-case-results/{test_case_result_id}/history","href":"/reference/v4/evaluations/get-all-versions-of-test-case-result"},{"title":"List Historical Test Case Results","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluations/{evaluation_id}/test-case-results/history/{num}","href":"/reference/v4/evaluations/list-historical-test-case-results"}]},{"group":"Evaluation Configs","pages":[{"title":"List Evaluation Configs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-configs","href":"/reference/v4/evaluation-configs/list-evaluation-configs"},{"title":"Create Evaluation Config","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-configs","href":"/reference/v4/evaluation-configs/create-evaluation-config"},{"title":"Get Evaluation Config","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-configs/{evaluation_config_id}","href":"/reference/v4/evaluation-configs/get-evaluation-config"},{"title":"Delete Evaluation Config","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluation-configs/{evaluation_config_id}","href":"/reference/v4/evaluation-configs/delete-evaluation-config"}]},{"group":"Evaluation Datasets","pages":[{"title":"List Evaluation Datasets","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets","href":"/reference/v4/evaluation-datasets/list-evaluation-datasets"},{"title":"Create Evaluation Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets","href":"/reference/v4/evaluation-datasets/create-evaluation-dataset"},{"title":"Get Evaluation Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}","href":"/reference/v4/evaluation-datasets/get-evaluation-dataset"},{"title":"Delete Evaluation Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluation-datasets/{evaluation_dataset_id}","href":"/reference/v4/evaluation-datasets/delete-evaluation-dataset"},{"title":"Update Evaluation Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluation-datasets/{evaluation_dataset_id}","href":"/reference/v4/evaluation-datasets/update-evaluation-dataset"},{"title":"List Evaluation Dataset Versions","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/evaluation-dataset-versions","href":"/reference/v4/evaluation-datasets/list-evaluation-dataset-versions"},{"title":"Create Evaluation Dataset Version","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/evaluation-dataset-versions","href":"/reference/v4/evaluation-datasets/create-evaluation-dataset-version"},{"title":"Get Evaluation Dataset Version","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/evaluation-dataset-versions/{evaluation_dataset_version_id}","href":"/reference/v4/evaluation-datasets/get-evaluation-dataset-version"},{"title":"List Test Cases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases","href":"/reference/v4/evaluation-datasets/list-test-cases"},{"title":"Create Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases","href":"/reference/v4/evaluation-datasets/create-test-case"},{"title":"Batch Create Test Cases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/batch","href":"/reference/v4/evaluation-datasets/batch-create-test-cases"},{"title":"Get Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}","href":"/reference/v4/evaluation-datasets/get-test-case"},{"title":"Delete Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}","href":"/reference/v4/evaluation-datasets/delete-test-case"},{"title":"Update Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}","href":"/reference/v4/evaluation-datasets/update-test-case"},{"title":"Get Historical Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}/history/{num}","href":"/reference/v4/evaluation-datasets/get-historical-test-case"},{"title":"Get All Versions of Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}/history","href":"/reference/v4/evaluation-datasets/get-all-versions-of-test-case"},{"title":"Wipe Full History of Test Cases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/{test_case_id}/history","href":"/reference/v4/evaluation-datasets/wipe-full-history-of-test-cases"},{"title":"List Historical Test Cases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/test-cases/history/{num}","href":"/reference/v4/evaluation-datasets/list-historical-test-cases"},{"title":"List Autogenerated Draft Test Cases","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases","href":"/reference/v4/evaluation-datasets/list-autogenerated-draft-test-cases"},{"title":"Create Autogenerated Draft Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases","href":"/reference/v4/evaluation-datasets/create-autogenerated-draft-test-case"},{"title":"Get Autogenerated Draft Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}","href":"/reference/v4/evaluation-datasets/get-autogenerated-draft-test-case"},{"title":"Delete Autogenerated Draft Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}","href":"/reference/v4/evaluation-datasets/delete-autogenerated-draft-test-case"},{"title":"Update Autogenerated Draft Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}","href":"/reference/v4/evaluation-datasets/update-autogenerated-draft-test-case"},{"title":"Approve Autogenerated Draft Test Case","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/autogenerated-draft-test-cases/{autogenerated_draft_test_case_id}/approve","href":"/reference/v4/evaluation-datasets/approve-autogenerated-draft-test-case"},{"title":"Publish Latest Evaluation Dataset Version","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/publish","href":"/reference/v4/evaluation-datasets/publish-latest-evaluation-dataset-version"},{"title":"Approve Auto Generated Test Cases Batch","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/approve-batch","href":"/reference/v4/evaluation-datasets/approve-auto-generated-test-cases-batch"},{"title":"Get Evaluation Dataset Generation Jobs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/generation-jobs","href":"/reference/v4/evaluation-datasets/get-evaluation-dataset-generation-jobs"},{"title":"Create Evaluation Dataset Generation Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/generation-jobs","href":"/reference/v4/evaluation-datasets/create-evaluation-dataset-generation-job"},{"title":"Get Evaluation Dataset Generation Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/evaluation-datasets/{evaluation_dataset_id}/generation-jobs/{generation_job_id}","href":"/reference/v4/evaluation-datasets/get-evaluation-dataset-generation-job"},{"title":"Cancel Evaluation Dataset Generation Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/generation-jobs/{generation_job_id}/cancel","href":"/reference/v4/evaluation-datasets/cancel-evaluation-dataset-generation-job"},{"title":"Publish Evaluation Dataset Version","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/evaluation-datasets/{evaluation_dataset_id}/evaluation-dataset-versions/{evaluation_dataset_version_id}/publish","href":"/reference/v4/evaluation-datasets/publish-evaluation-dataset-version"}]},{"group":"Studio Projects","pages":[{"title":"List Studio Projects","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/studio-projects","href":"/reference/v4/studio-projects/list-studio-projects"},{"title":"Create Studio Project","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/studio-projects","href":"/reference/v4/studio-projects/create-studio-project"},{"title":"Get Studio Project","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/studio-projects/{studio_project_id}","href":"/reference/v4/studio-projects/get-studio-project"},{"title":"Delete Studio Project","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/studio-projects/{studio_project_id}","href":"/reference/v4/studio-projects/delete-studio-project"},{"title":"Update Studio Project","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/studio-projects/{studio_project_id}","href":"/reference/v4/studio-projects/update-studio-project"}]},{"group":"Application Specs","pages":[{"title":"List Application Specs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-specs","href":"/reference/v4/application-specs/list-application-specs"},{"title":"Create Application Spec","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-specs","href":"/reference/v4/application-specs/create-application-spec"},{"title":"Get Application Spec","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-specs/{application_spec_id}","href":"/reference/v4/application-specs/get-application-spec"},{"title":"Delete Application Spec","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/application-specs/{application_spec_id}","href":"/reference/v4/application-specs/delete-application-spec"},{"title":"Update Application Spec","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/application-specs/{application_spec_id}","href":"/reference/v4/application-specs/update-application-spec"}]},{"group":"Questions","pages":[{"title":"List Questions","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/questions","href":"/reference/v4/questions/list-questions"},{"title":"Create Question","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/questions","href":"/reference/v4/questions/create-question"},{"title":"Get Question","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/questions/{question_id}","href":"/reference/v4/questions/get-question"}]},{"group":"Knowledge Base Data Sources","pages":[{"title":"List Knowledge Base Data Sources","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-base-data-sources","href":"/reference/v4/knowledge-base-data-sources/list-knowledge-base-data-sources"},{"title":"Create Knowledge Base Data Source","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/knowledge-base-data-sources","href":"/reference/v4/knowledge-base-data-sources/create-knowledge-base-data-source"},{"title":"Get Knowledge Base Data Source","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/knowledge-base-data-sources/{knowledge_base_data_source_id}","href":"/reference/v4/knowledge-base-data-sources/get-knowledge-base-data-source"},{"title":"Delete Knowledge Base Data Source","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/knowledge-base-data-sources/{knowledge_base_data_source_id}","href":"/reference/v4/knowledge-base-data-sources/delete-knowledge-base-data-source"},{"title":"Update Knowledge Base Data Source","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/knowledge-base-data-sources/{knowledge_base_data_source_id}","href":"/reference/v4/knowledge-base-data-sources/update-knowledge-base-data-source"}]},{"group":"Model Templates V3 (Beta)","pages":[{"title":"List Model Templates","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-templates","href":"/reference/v4/model-templates-v3-beta/list-model-templates"},{"title":"Create Model Template","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/model-templates","href":"/reference/v4/model-templates-v3-beta/create-model-template"},{"title":"Get Model Template","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/model-templates/{model_template_id}","href":"/reference/v4/model-templates-v3-beta/get-model-template"},{"title":"Delete Model Template","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/model-templates/{model_template_id}","href":"/reference/v4/model-templates-v3-beta/delete-model-template"}]},{"group":"Model server","pages":[{"title":"Fixed Server interface for Model execution","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving/{model_server_id}/execute","href":"/reference/v4/model-server/fixed-server-interface-for-model-execution"},{"title":"Fixed Server interface for async Model execution","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving/{model_server_id}/executeAsync","href":"/reference/v4/model-server/fixed-server-interface-for-async-model-execution"},{"title":"Poll Async Inference for result","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving/{model_server_id}/pollAsync/{async_task_id}","href":"/reference/v4/model-server/poll-async-inference-for-result"},{"title":"Fixed Server interface for Model execution by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving/a/{alias}/execute","href":"/reference/v4/model-server/fixed-server-interface-for-model-execution-by-named-alias"},{"title":"Fixed Server interface for async Model execution by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving/a/{alias}/executeAsync","href":"/reference/v4/model-server/fixed-server-interface-for-async-model-execution-by-named-alias"},{"title":"Poll Async Inference for result by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving/a/{alias}/pollAsync/{async_task_id}","href":"/reference/v4/model-server/poll-async-inference-for-result-by-named-alias"},{"title":"Create a new Model Server","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving","href":"/reference/v4/model-server/create-a-new-model-server"},{"title":"Get current deployment of the Model Server","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving/{model_server_id}/deployment","href":"/reference/v4/model-server/get-current-deployment-of-the-model-server"},{"title":"Change backend of the Model Server","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml put /v4/serving/{model_server_id}/backend","href":"/reference/v4/model-server/change-backend-of-the-model-server"},{"title":"Rollback backend of the Model Server","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/serving/{model_server_id}/rollback","href":"/reference/v4/model-server/rollback-backend-of-the-model-server"}]},{"group":"API Reference","pages":[{"title":"Fixed Server interface for Model execution by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving","href":"/reference/v4/fixed-server-interface-for-model-execution-by-named-alias"},{"title":"Fixed Server interface for Model execution by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving/{model_server_id}","href":"/reference/v4/fixed-server-interface-for-model-execution-by-named-alias-1"},{"title":"Delete a Model Server","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/serving/{model_server_id}","href":"/reference/v4/delete-a-model-server"},{"title":"Fixed Server interface for Model execution by named alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/serving/a/{alias}","href":"/reference/v4/fixed-server-interface-for-model-execution-by-named-alias-2"}]},{"group":"Fine Tuning Jobs V3 (Beta)","pages":[{"title":"List Fine Tuning Jobs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/fine-tuning-jobs","href":"/reference/v4/fine-tuning-jobs-v3-beta/list-fine-tuning-jobs"},{"title":"Create Fine Tuning Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/fine-tuning-jobs","href":"/reference/v4/fine-tuning-jobs-v3-beta/create-fine-tuning-job"},{"title":"Get Fine Tuning Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/fine-tuning-jobs/{fine_tuning_job_id}","href":"/reference/v4/fine-tuning-jobs-v3-beta/get-fine-tuning-job"},{"title":"Delete Fine Tuning Job","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/fine-tuning-jobs/{fine_tuning_job_id}","href":"/reference/v4/fine-tuning-jobs-v3-beta/delete-fine-tuning-job"},{"title":"Get fine tuning job events","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/fine-tuning-jobs/{fine_tuning_job_id}/events","href":"/reference/v4/fine-tuning-jobs-v3-beta/get-fine-tuning-job-events"}]},{"group":"Training Datasets V3 (Beta)","pages":[{"title":"List Training Datasets","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/training-datasets","href":"/reference/v4/training-datasets-v3-beta/list-training-datasets"},{"title":"Create Training Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/training-datasets","href":"/reference/v4/training-datasets-v3-beta/create-training-dataset"},{"title":"Get Training Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/training-datasets/{training_dataset_id}","href":"/reference/v4/training-datasets-v3-beta/get-training-dataset"},{"title":"Delete Training Dataset","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/training-datasets/{training_dataset_id}","href":"/reference/v4/training-datasets-v3-beta/delete-training-dataset"},{"title":"Get Training Dataset Contents","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/training-datasets/{training_dataset_id}/contents","href":"/reference/v4/training-datasets-v3-beta/get-training-dataset-contents"}]},{"group":"package deployments","pages":[{"title":"Install a deployment packages","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/deployment-packages/{account_id}/install","href":"/reference/v4/package-deployments/install-a-deployment-packages"},{"title":"Copy a deployment package to control plane hook","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/deployment-packages/{account_id}/copy-to-control-plane-hook","href":"/reference/v4/package-deployments/copy-a-deployment-package-to-control-plane-hook"},{"title":"Install a deployment packages","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/deployment-packages/{account_id}/install_async","href":"/reference/v4/package-deployments/install-a-deployment-packages-1"},{"title":"Verify that the prerequisites for installing a specific package version are met","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/deployment-packages/{account_id}/verify-install-prerequisites-met","href":"/reference/v4/package-deployments/verify-that-the-prerequisites-for-installing-a-specific-package-version-are-met"}]},{"group":"Beta","pages":[{"title":"Generate OpenAI chat completion from messages","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/beta/chat/completions","href":"/reference/v4/beta/generate-openai-chat-completion-from-messages"},{"title":"Generate legacy text completion from prompt","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/beta/completions","href":"/reference/v4/beta/generate-legacy-text-completion-from-prompt"},{"title":"List files","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/beta/files","href":"/reference/v4/beta/list-files"},{"title":"Upload file bytes directly","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/beta/files","href":"/reference/v4/beta/upload-file-bytes-directly"},{"title":"Get file metadata","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/beta/files/{file_id}","href":"/reference/v4/beta/get-file-metadata"},{"title":"Delete a file","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/beta/files/{file_id}","href":"/reference/v4/beta/delete-a-file"},{"title":"Update a file","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/beta/files/{file_id}","href":"/reference/v4/beta/update-a-file"},{"title":"Download file content","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/beta/files/{file_id}/content","href":"/reference/v4/beta/download-file-content"}]},{"group":"Applications","pages":[{"title":"List Application Variants","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-variants","href":"/reference/v4/applications/list-application-variants"},{"title":"Create Application Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-variants","href":"/reference/v4/applications/create-application-variant"},{"title":"Get Application Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-variants/{application_variant_id}","href":"/reference/v4/applications/get-application-variant"},{"title":"Delete Application Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/application-variants/{application_variant_id}","href":"/reference/v4/applications/delete-application-variant"},{"title":"Update Application Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/application-variants/{application_variant_id}","href":"/reference/v4/applications/update-application-variant"},{"title":"List Application Deployments","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-deployments","href":"/reference/v4/applications/list-application-deployments"},{"title":"Create Application Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-deployments","href":"/reference/v4/applications/create-application-deployment"},{"title":"Get Application Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-deployments/{application_deployment_id}","href":"/reference/v4/applications/get-application-deployment"},{"title":"Update Application Deployment","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/application-deployments/{application_deployment_id}","href":"/reference/v4/applications/update-application-deployment"},{"title":"List Application Variant Reports","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-variant-reports","href":"/reference/v4/applications/list-application-variant-reports"},{"title":"Create Application Variant Report","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-variant-reports","href":"/reference/v4/applications/create-application-variant-report"},{"title":"Get Application Variant Report","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-variant-reports/{application_variant_report_id}","href":"/reference/v4/applications/get-application-variant-report"},{"title":"List Application Test Case Outputs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-test-case-outputs","href":"/reference/v4/applications/list-application-test-case-outputs"},{"title":"Batch Create Application Test Case Outputs","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-test-case-outputs/batch","href":"/reference/v4/applications/batch-create-application-test-case-outputs"},{"title":"Get Application Test Case Output","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-test-case-outputs/{application_test_case_output_id}","href":"/reference/v4/applications/get-application-test-case-output"},{"title":"Create Application With Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-with-variant","href":"/reference/v4/applications/create-application-with-variant"},{"title":"Get Application Schemas","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/application-schemas","href":"/reference/v4/applications/get-application-schemas"},{"title":"Process Application","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/process","href":"/reference/v4/applications/process-application"},{"title":"Process Application By Id","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/{application_variant_id}/process","href":"/reference/v4/applications/process-application-by-id"},{"title":"Process Deployed Application For Thread","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/{application_variant_id}/threads/{thread_id}/process","href":"/reference/v4/applications/process-deployed-application-for-thread"},{"title":"Process Application By Alias","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/process/{application_alias}","href":"/reference/v4/applications/process-application-by-alias"},{"title":"Validate Application","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/validate","href":"/reference/v4/applications/validate-application"},{"title":"List Application Threads","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/applications/{application_variant_id}/threads","href":"/reference/v4/applications/list-application-threads"},{"title":"Create New Application Thread","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/{application_variant_id}/threads","href":"/reference/v4/applications/create-new-application-thread"},{"title":"Upload Application Files","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/applications/upload-files","href":"/reference/v4/applications/upload-application-files"},{"title":"Publish Application Variant","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/application-variants/{application_variant_id}/publish","href":"/reference/v4/applications/publish-application-variant"}]},{"group":"ChatThreads","pages":[{"title":"Get Thread Messages","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/threads/{thread_id}/messages","href":"/reference/v4/chatthreads/get-thread-messages"},{"title":"Delete Chat Thread","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/threads/{thread_id}","href":"/reference/v4/chatthreads/delete-chat-thread"},{"title":"Patch Chat Thread","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/threads/{thread_id}","href":"/reference/v4/chatthreads/patch-chat-thread"},{"title":"Patch Chat Thread Entry","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/threads/{thread_id}/messages/{application_interaction_id}","href":"/reference/v4/chatthreads/patch-chat-thread-entry"},{"title":"Add Feedback To Thread Entry","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml put /v4/threads/{thread_id}/messages/{application_interaction_id}/feedback","href":"/reference/v4/chatthreads/add-feedback-to-thread-entry"},{"title":"Delete Interaction Feedback","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/threads/{thread_id}/messages/{application_interaction_id}/feedback","href":"/reference/v4/chatthreads/delete-interaction-feedback"}]},{"group":"Interactions","pages":[{"title":"Create Application Interaction","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/interactions/","href":"/reference/v4/interactions/create-application-interaction"},{"title":"Get Interaction Feedback","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/interactions/{application_interaction_id}/feedback","href":"/reference/v4/interactions/get-interaction-feedback"}]},{"group":"MonitoringDashboard","pages":[{"title":"Get Dashboard Schema","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/applications/{application_spec_id}/dashboards/{dashboard_id}","href":"/reference/v4/monitoringdashboard/get-dashboard-schema"},{"title":"Get Scalar Metric","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/applications/{application_spec_id}/metrics/scalar/{metric_id}","href":"/reference/v4/monitoringdashboard/get-scalar-metric"},{"title":"Get Timeseries Metric","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/applications/{application_spec_id}/metrics/timeseries/{metric_id}","href":"/reference/v4/monitoringdashboard/get-timeseries-metric"}]},{"group":"Chat Themes","pages":[{"title":"List Themes","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/themes","href":"/reference/v4/chat-themes/list-themes"},{"title":"Create Theme","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/themes","href":"/reference/v4/chat-themes/create-theme"},{"title":"Get Theme","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/themes/{theme_id}","href":"/reference/v4/chat-themes/get-theme"}]},{"group":"Sessions","pages":[{"title":"List Sessions","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/sessions","href":"/reference/v4/sessions/list-sessions"},{"title":"Create Session","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml post /v4/sessions","href":"/reference/v4/sessions/create-session"},{"title":"Get Session","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml get /v4/sessions/{session_id}","href":"/reference/v4/sessions/get-session"},{"title":"Delete Session","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml delete /v4/sessions/{session_id}","href":"/reference/v4/sessions/delete-session"},{"title":"Update Session","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml patch /v4/sessions/{session_id}","href":"/reference/v4/sessions/update-session"}]},{"group":"account groups","pages":[{"title":"Upsert General Role Restriction","deprecated":null,"version":null,"openapi":"/openapi/v4.yaml put /v4/account-groups/general-role-restrictions/{role}","href":"/reference/v4/account-groups/upsert-general-role-restriction"}]}]},{"tab":"Recipes","pages":[{"title":"Recipes","href":"/recipes/flexible-evaluations"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/changelog/release-notes"}]}]}]},"basePath":"","title":"Create Chat Completion - Scale","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CalkZbx8.js","snippetPresets-DtvvunBK.js","utils-Bn5byECU.js","style-to-object-BY3JEAdk.js","utils-DOTAoFcT.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CDauU9aU.js","conditional-requirements-CFM0id0Q.js","cloneDeep-k2aHAqp5.js","_Uint8Array-CQuRedKT.js","isObject-FP1Yky1u.js","ApiExamples-CSBS2nDe.js","usePlaygroundInputsStore-BkN7uKke.js","shallow-6IMgYiEa.js","isEqual-DicuCknl.js","CodeSnippets-C268fsRY.js","CodeSnippet-BBA8eWiP.js","getApiPlaygroundDisplay-DMK5GRGS.js","Page-Dz3zehSO.js","api-description-markdown-DwoksVHI.js","DynamicMarkdown-XsrWkK-b.js","SectionHeading-AR_EzDYe.js","MethodPill-CvOL8UTX.js","getPastedJson-BazkMjRw.js","Check2Icon-BL_xILK9.js","axios-CsQoIw0U.js","Markdown-CX8Sr5UZ.js","AssistantPageLink-B3VcLrB0.js","dist-WDJo6xkj.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}