Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.
Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.To request successfully, it is mandatory to enter a Personal API Key (e.g. flp_XXX) value in the Bearer Token field.
Refer to the authentication section on our introduction page to learn how to acquire this variable and visit here to generate your API Key.
Authorizations
Authorization
string
header
required
When using Friendli Suite API, you need to provide a Personal API Key (e.g. flp_XXX) as a Bearer token for authentication and authorization purposes.
ID of team to run requests as (optional parameter).
Body
application/json
model
string
required
ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.
A list of messages comprising the conversation so far.
System
User
Assistant
Tool
Hide child attributes
messages.role
string
required
The role of the messages author.
Allowed value: "system"
messages.content
string
required
The content of system message.
messages.name
string | null
The name for the participant to distinguish between participants with the same role.
Example:
[ { "content": "You are a helpful assistant.", "role": "system" }, { "content": "Hello!", "role": "user" } ]
chat_template_kwargs
Chat Template Kwargs · object | null
Additional keyword arguments supplied to the template renderer. These parameters will be available for use within the chat template.
eos_token
integer[] | null
A list of endpoint sentence tokens.
frequency_penalty
number | null
Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled, taking into account their frequency in the preceding text. This penalization diminishes the model's tendency to reproduce identical lines verbatim.
logit_bias
Logit Bias · object | null
Accepts a JSON object that maps tokens to an associated bias value. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model.
logprobs
boolean | null
Whether to return log probabilities of the output tokens or not.
max_tokens
integer | null
The maximum number of tokens to generate. For decoder-only models like GPT, the length of your input tokens plus max_tokens should not exceed the model's maximum length (e.g., 2048 for OpenAI GPT-3). For encoder-decoder models like T5 or BlenderBot, max_tokens should not exceed the model's maximum output length. This is similar to Hugging Face's max_new_tokens argument.
min_p
number | null
A scaling factor used to determine the minimum token probability threshold. This threshold is calculated as min_p multiplied by the probability of the most likely token. Tokens with probabilities below this scaled threshold are excluded from sampling. Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values result in stricter filtering, while lower values allow for greater diversity. The default value of 0.0 disables filtering, allowing all tokens to be considered for sampling.
n
integer | null
The number of independently generated results for the prompt. Defaults to 1. This is similar to Hugging Face's num_return_sequences argument.
parallel_tool_calls
boolean | null
Whether to enable parallel function calling.
presence_penalty
number | null
Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled at least once in the existing text.
repetition_penalty
number | null
Penalizes tokens that have already appeared in the generated result (plus the input tokens for decoder-only models). Should be a positive value (1.0 means no penalty and is the default). See Keskar et al., 2019 for more details. This is similar to Hugging Face's repetition_penalty argument.
Required range: x > 0
reasoning_effort
enum<string> | null
Sets how much reasoning the model does before answering. Higher values give more thorough responses but take longer. This affects reasoning models only, and the available options depend on the model.
Available options:
minimal,
low,
medium,
high,
xhigh,
max,
ultracode
reasoning_budget
integer | null
Specifies a positive integer that defines a limit on the number of tokens used for internal reasoning tokens. This parameter is only effective for reasoning models.
seed
integer[]integer
Seed to control random procedure. If nothing is given, random seed is used for sampling, and return the seed along with the generated result. When using the n argument, you can pass a list of seed values to control all of the independent generations.
stop
string[] | null
When one of the stop phrases appears in the generation result, the API will stop generation. The stop phrases are excluded from the result. Defaults to empty list.
stream
boolean
default:false
Whether to stream the generation result. When set to true, each token is sent as server-sent events once generated.
stream_options
StreamOptions · object | null
Options related to stream.
It can only be used when stream: true.
Hide child attributes
stream_options.include_usage
boolean | null
When set to true,
the number of tokens used will be included at the end of the stream result in the form of
"usage": {"completion_tokens": number, "prompt_tokens": number, "total_tokens": number}.
parse_reasoning
boolean | null
Parses model reasoning into reasoning_content while keeping the answer in content. Default value may vary between endpoints.
Sampling temperature. Smaller temperature makes the generation result closer to greedy, argmax (i.e., top_k = 1) sampling. Defaults to 1.0. This is similar to Hugging Face's temperature argument.
tool_choice
ChatCompleteBodyToolChoice · objectstring
Determines the tool calling behavior of the model.
When set to none, the model will bypass tool execution and generate a response directly.
In auto mode (the default), the model dynamically decides whether to call a tool or respond with a message.
Alternatively, setting required ensures that the model invokes at least one tool before responding to the user.
You can also specify a particular tool by {"type": "function", "function": {"name": "my_function"}}.
Hide child attributes
tool_choice.type
string
required
The type of the tool. Currently, only function is supported.
Allowed value: "function"
tool_choice.function
ChatCompleteBodyToolChoiceFunction · object
required
Hide child attributes
tool_choice.function.name
string
required
The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
top_k
integer | null
Limits sampling to the top k tokens with the highest probabilities. Values range from 0 (no filtering) to the model's vocabulary size (inclusive). The default value of 0 applies no filtering, allowing all tokens.
top_logprobs
integer | null
The number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
top_p
number | null
Keeps only the smallest set of tokens whose cumulative probabilities reach top_p or higher. Values range from 0.0 to 1.0 (inclusive). The default value of 1.0 includes all tokens, allowing maximum diversity.
xtc_threshold
number | null
A probability threshold used to identify “top choice” tokens for exclusion in XTC (Exclude Top Choices) sampling. Tokens with probabilities at or above this threshold are considered viable candidates, and all but the least likely viable token are excluded from sampling. This option reduces the dominance of highly probable tokens while preserving some diversity by keeping the least confident “top choice.” Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values make the filtering more selective by requiring higher probabilities to trigger exclusion, while lower values apply filtering more broadly. The default value of 0.0 disables XTC filtering entirely.
xtc_probability
number | null
The probability that XTC (Exclude Top Choices) filtering will be applied for each sampling decision. When XTC is triggered, high-probability tokens above the xtc_threshold are excluded except for the least likely viable token. This stochastic activation allows for a balance between standard sampling and creativity-boosting exclusion filtering. Values range from 0.0 (inclusive) to 1.0 (inclusive), where 0.0 means XTC is never applied, 1.0 means XTC is always applied when viable tokens exist, and intermediate values provide probabilistic activation. The default value of 0.0 disables XTC filtering.
tools
Tool · object[] | null
A list of tools the model may call.
Use this to provide a list of functions the model may generate JSON inputs for.
When tools is specified, min_tokens and response_format fields are unsupported.
Hide child attributes
tools.type
string
required
The type of the tool. Currently, only function is supported.
Allowed value: "function"
tools.function
Function · object
required
Hide child attributes
tools.function.name
string
required
The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
tools.function.parameters
Parameters · object
required
The parameters the functions accepts, described as a JSON Schema object.
To represent a function with no parameters, use the value {"type": "object", "properties": {}}.
tools.function.description
string | null
A description of what the function does, used by the model to choose when and how to call the function.
min_tokens
integer | null
The minimum number of tokens to generate. Default value is 0. This is similar to Hugging Face's min_new_tokens argument.
This field is unsupported when tools or response_format is specified.
response_format
Json Schema · object
The enforced format of the model's output.
Note that the content of the output message may be truncated if it exceeds the max_tokens. You can check this by verifying that the finish_reason of the output message is length.
Important
You must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., You are an API generating a valid JSON as output.).
Otherwise, the model may result in an unending stream of whitespace or other characters.
This field is unsupported when tools is specified.When response_format is specified, min_tokens field is unsupported.
Json Schema
Json Object
Regex
Text
Hide child attributes
response_format.type
string
required
The type of the response format: json_schema.
Allowed value: "json_schema"
response_format.json_schema
ResponseFormatJsonSchemaSchema · object
required
Hide child attributes
response_format.json_schema.schema
Schema · object
required
The schema for the response format, described as a JSON Schema object.
Response
Chat completion, or an SSE stream when stream is true.
id
string
required
A unique ID of the chat completion.
choices
ChatChoice · object[]
required
Hide child attributes
choices.index
integer
required
The index of the choice in the list of generated choices.
Example:
0
choices.message
ChatChoiceMessage · object
required
Hide child attributes
choices.message.role
string
required
Role of the generated message author, in this case assistant.
choices.message.content
string | null
The contents of the assistant message.
choices.message.tool_calls
ToolCallResult · object[] | null
Hide child attributes
choices.message.tool_calls.type
string
required
The type of the tool.
Allowed value: "function"
choices.message.tool_calls.id
string
required
The ID of the tool call.
choices.message.tool_calls.function
FunctionResult · object
required
Hide child attributes
choices.message.tool_calls.function.arguments
string
required
The arguments for calling the function, generated by the model in JSON format.
Ensure to validate these arguments in your code before invoking the function since the model may not always produce valid JSON.
choices.message.tool_calls.function.name
string
required
The name of the function to call.
choices.finish_reason
enum<string>
required
Termination condition of the generation. stop means the API returned the full chat completions generated by the model without running into any limits.
length means the generation exceeded max_tokens or the conversation exceeded the max context length.
tool_calls means the API has generated tool calls.
Available options:
stop,
length,
tool_calls
choices.logprobs
ChatLogprobs · object | null
Hide child attributes
choices.logprobs.content
ChatLogprobsContent · object[] | null
A list of message content tokens with log probability information.
Hide child attributes
choices.logprobs.content.token
string
required
The token.
choices.logprobs.content.logprob
number
required
The log probability of this token.
choices.logprobs.content.top_logprobs
ChatLogprobsContentTopLogprob · object[]
required
List of the most likely tokens and their log probability, at this token position.
Hide child attributes
choices.logprobs.content.top_logprobs.token
string
required
The token.
choices.logprobs.content.top_logprobs.logprob
number
required
The log probability of this token.
choices.logprobs.content.top_logprobs.bytes
integer[] | null
A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.
choices.logprobs.content.bytes
integer[] | null
A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.
usage
ChatUsage · object
required
Hide child attributes
usage.prompt_tokens
integer
required
Number of tokens in the prompt.
Example:
5
usage.completion_tokens
integer
required
Number of tokens in the generated chat completions.
Example:
7
usage.total_tokens
integer
required
Total number of tokens used in the request (prompt_tokens + completion_tokens).
Example:
12
usage.prompt_tokens_details
PromptTokensDetails · object | null
Breakdown of tokens used in the prompt.
Hide child attributes
usage.prompt_tokens_details.cached_tokens
integer | null
Cached tokens present in the prompt.
object
string
required
The object type, which is always set to chat.completion.
Allowed value: "chat.completion"
created
integer
required
The Unix timestamp (in seconds) for when the generation completed.
model
string | null
The model to generate the completion. For dedicated endpoints, it returns the endpoint ID.
Last modified on June 9, 2026
Was this page helpful?
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"FriendliAI Docs","description":"Let your team focus on building great AI products. FriendliAI will make sure your AI runs fast, affordable, and reliable at scale. Leave the hassle of AI inference to FriendliAI.","colors":{"primary":"#2A62DB","light":"#4f87ff","dark":"#1e469b"},"logo":{"light":"https://mintcdn.com/friendliai/Xn-EfFlXFvptInk9/static/svgs/logo.svg?fit=max\u0026auto=format\u0026n=Xn-EfFlXFvptInk9\u0026q=85\u0026s=0a04a5dd2152a1258e6d3ce995b70eb0","dark":"https://mintcdn.com/friendliai/OmGyXdVnt91Gfn8z/static/svgs/logo-dark.svg?fit=max\u0026auto=format\u0026n=OmGyXdVnt91Gfn8z\u0026q=85\u0026s=7bc2b761b9c8da66973a9869b7de4f90"},"favicon":"https://mintcdn.com/friendliai/Xn-EfFlXFvptInk9/static/svgs/favicon.svg?fit=max\u0026auto=format\u0026n=Xn-EfFlXFvptInk9\u0026q=85\u0026s=d425e1903adeb917593a54eb3d20c66b","api":{"openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript","go"],"prefill":true,"autogenerate":true}},"background":{"color":{"light":"#FFFFFF","dark":"#0A101A"}},"navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://friendli.ai/get-started/dedicated-endpoints"}},"footer":{"socials":{"website":"https://friendli.ai","linkedin":"https://www.linkedin.com/company/friendliai","youtube":"https://www.youtube.com/@friendliai","github":"https://github.com/friendliai","discord":"https://discord.gg/g53ByexhR","x":"https://x.com/friendliai","medium":"https://medium.com/friendliai","facebook":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","slack":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","instagram":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","hacker-news":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","telegram":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","twitter":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","x-twitter":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","earth-americas":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","bluesky":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","threads":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","reddit":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css","podcast":"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css"}},"search":{"prompt":"Search FriendliAI Docs..."},"seo":{"metatags":{"og:site_name":"FriendliAI Docs","twitter:card":"summary_large_image"}},"integrations":{"gtm":{"tagId":"GTM-MVXVF29V"},"telemetry":{"enabled":true}},"banner":{"content":"Try [GLM-5.3](https://friendli.ai/models/zai-org/GLM-5.3) and [GLM-5.3-Flash](https://friendli.ai/models/zai-org/GLM-5.3-Flash) today. To learn more, see the [FriendliAI Blog](https://friendli.ai/blog)."},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Home","icon":"home","href":"https://friendli.ai"},{"anchor":"Models","icon":"brain","href":"https://friendli.ai/models"},{"anchor":"Pricing","icon":"tag","href":"https://friendli.ai/pricing"},{"anchor":"Blog","icon":"newspaper","href":"https://friendli.ai/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"friendliai","hasAudioNarration":false,"actualSubdomain":"friendliai","customDomains":["friendli.ai"],"gitSource":{"type":"github","owner":"friendliai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6affa52095a415ad176e2a10","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Guides","count":45},{"language":"default","tag":"Examples","count":40},{"language":"default","tag":"Reference","count":36},{"language":"default","tag":"Inference","count":30},{"language":"default","tag":"Archive","count":24},{"language":"default","tag":"Dedicated","count":24},{"language":"default","tag":"Friendli Container","count":23},{"language":"default","tag":"Agents","count":14},{"language":"default","tag":"Friendli Dedicated Endpoints","count":12},{"language":"default","tag":"API Reference","count":12}]},"assistantConfig":{"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"deflection":{"enabled":true,"email":"support@friendli.ai","showHelpButton":true}},"basePath":"/docs","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":"workos-onboarding","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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"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":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5Z5ClqOw.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5Q5ClqOw.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK7uxQxXAuk.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5b5ClqOw.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5a5ClqOw.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5U5Ck.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n@font-face{font-family:\"Saans-Light\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-Light.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-Light.woff\") format(\"woff\");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:\"Saans-Regular\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-Regular.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-Regular.woff\")\n\t\tformat(\"woff\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Saans-Medium\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-Medium.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-Medium.woff\")\n\t\tformat(\"woff\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"Saans-SemiBold\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-SemiBold.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-SemiBold.woff\")\n\t\tformat(\"woff\");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:\"Saans-Bold\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-Bold.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-Bold.woff\") format(\"woff\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Saans-Heavy\";src:url(\"https://docs-assets.friendli.ai/fonts/Saans-Heavy.woff2\")\n\t\tformat(\"woff2\"),\n\t\turl(\"https://docs-assets.friendli.ai/fonts/Saans-Heavy.woff\") format(\"woff\");font-weight:800;font-style:normal;font-display:swap}:root{--gray-300: 159 179 200;--primary-accent: #0095ff}.border-gray-100{border-color:#d9e2ec}body{font-family:\"Saans-Regular\", sans-serif;letter-spacing:0.01em}.tracking-tighter{letter-spacing:-0.04em}.tracking-tight{letter-spacing:0.01em}.tracking-normal{letter-spacing:0.01em}.tracking-wide{letter-spacing:0.01em}.tracking-wider{letter-spacing:0.05em}.tracking-widest{letter-spacing:0.1em}.prose :where(h1,h2,h3):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)){letter-spacing:0}.font-medium:not(.font-mono):not(.font-mono *),.mint-font-medium:not(.font-mono):not(.font-mono *){font-family:\"Saans-Medium\", sans-serif}h1:not(.font-mono):not(.font-mono *),h2:not(.font-mono):not(.font-mono *),h3:not(.font-mono):not(.font-mono *),h4:not(.font-mono):not(.font-mono *),h5:not(.font-mono):not(.font-mono *),strong:not(.font-mono):not(.font-mono *),.font-semibold:not(.font-mono):not(.font-mono *),.mint-font-semibold:not(.font-mono):not(.font-mono *),.prose :where(a):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)):not(.font-mono):not(.font-mono *){font-family:\"Saans-SemiBold\", sans-serif}.prose :is(p,li,td,dd) svg.icon{vertical-align:-0.025em!important}.prose :is(p,li,td,dd) a[href^=\"http\"]:not([href*=\"friendli.ai\"]):not(:has(img))::after{content:\"\";display:inline-block;width:0.7em;height:0.7em;margin-left:0.2em;vertical-align:-0.05em;background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20d%3D%22M320%200c-17.7%200-32%2014.3-32%2032s14.3%2032%2032%2032l82.7%200-201.4%20201.4c-12.5%2012.5-12.5%2032.8%200%2045.3s32.8%2012.5%2045.3%200L448%20109.3%20448%20192c0%2017.7%2014.3%2032%2032%2032s32-14.3%2032-32l0-160c0-17.7-14.3-32-32-32L320%200zM80%2096C35.8%2096%200%20131.8%200%20176L0%20432c0%2044.2%2035.8%2080%2080%2080l256%200c44.2%200%2080-35.8%2080-80l0-80c0-17.7-14.3-32-32-32s-32%2014.3-32%2032l0%2080c0%208.8-7.2%2016-16%2016L80%20448c-8.8%200-16-7.2-16-16l0-256c0-8.8%207.2-16%2016-16l80%200c17.7%200%2032-14.3%2032-32s-14.3-32-32-32L80%2096z%22%2F%3E%3C%2Fsvg%3E\")\n\t\tno-repeat center / contain;mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%3E%3Cpath%20d%3D%22M320%200c-17.7%200-32%2014.3-32%2032s14.3%2032%2032%2032l82.7%200-201.4%20201.4c-12.5%2012.5-12.5%2032.8%200%2045.3s32.8%2012.5%2045.3%200L448%20109.3%20448%20192c0%2017.7%2014.3%2032%2032%2032s32-14.3%2032-32l0-160c0-17.7-14.3-32-32-32L320%200zM80%2096C35.8%2096%200%20131.8%200%20176L0%20432c0%2044.2%2035.8%2080%2080%2080l256%200c44.2%200%2080-35.8%2080-80l0-80c0-17.7-14.3-32-32-32s-32%2014.3-32%2032l0%2080c0%208.8-7.2%2016-16%2016L80%20448c-8.8%200-16-7.2-16-16l0-256c0-8.8%207.2-16%2016-16l80%200c17.7%200%2032-14.3%2032-32s-14.3-32-32-32L80%2096z%22%2F%3E%3C%2Fsvg%3E\")\n\t\tno-repeat center / contain}code:not(.font-mono *),pre,kbd,.font-mono{font-family:\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace}#banner{background-color:var(--primary-accent);font-size:16px;box-shadow:none}#banner>div{margin-top:0.625rem;margin-bottom:0.625rem;p {\n\t\tcolor: #ffffff;\n\t}\n\n\ta {\n\t\tcolor: #ffffff;\n\t\tfont-weight: 600;\n\t\ttext-decoration: underline;\n\t\tpadding-left: 0.25rem;\n\t}}#topbar-cta-button,#topbar-cta-button a,#topbar-cta-button.bg-primary-dark,#topbar-cta-button .bg-primary-dark{background-color:#2a62db!important;color:#ffffff!important;border:none!important;border-radius:6px;box-shadow:none!important}#topbar-cta-button:hover,#topbar-cta-button:hover a,#topbar-cta-button:hover .bg-primary-dark,#topbar-cta-button a:hover,#topbar-cta-button a:hover .bg-primary-dark,#topbar-cta-button.bg-primary-dark:hover,#topbar-cta-button .bg-primary-dark:hover{background-color:#1a4ec4!important}#topbar-cta-button>.font-medium,#topbar-cta-button>.mint-font-medium{font-family:\"Saans-Medium\", sans-serif}#header>div:not(:first-child){display:none}.card>div>div:last-child>div{margin-top:0.5rem}.card [data-component-part=\"card-content\"]{font-family:\"Saans-Regular\", sans-serif}.card-group.columns{gap:1rem}.rounded-border-box{padding:28px 44px;border:1px solid #d9e2ec;border-radius:8px;overflow:hidden;img {\n\t\tmargin: 0 auto;\n\t\tborder: 1px solid #e7eef4;\n\t\tborder-radius: 8px;\n\t}\n\n\tp {\n\t\tmargin: 12px auto -12px;\n\t\ttext-align: center;\n\t\tword-break: break-all;\n\t}}.dark .rounded-border-box{border:1px solid #243b53}.dark .rounded-border-box img{border:1px solid #212832}html[data-current-path=\"/\"] .nav-tabs-item[data-active]{text-shadow:none}html[data-current-path=\"/\"] .nav-tabs-item[data-active]>div{display:none}html[data-current-path=\"/\"] #content-container{max-width:none;padding-inline:1rem}html[data-current-path=\"/\"] #header{display:none}html[data-current-path=\"/\"] #content{margin-top:0}#footer [href=\"https://friendli.ai/?unused-social-placeholder-required-by-zod-4-hidden-by-css\"]{display:none}"}]}
{"page":{"pagePath":"openapi/dedicated/inference/chat-completions","slug":"/openapi/dedicated/inference/chat-completions","pageMetadata":{"title":"Dedicated Chat Completions","description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","deprecated":null,"version":null,"sidebarTitle":"Chat Completions","og:title":"Dedicated Chat Completions","og:description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/chat/completions","href":"/openapi/dedicated/inference/chat-completions","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,p:`p`,strong:`strong`,..._provideComponents(),...props.components};return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.`}),`\n`,_jsxs(_components.p,{children:[`To request successfully, it is mandatory to enter a `,_jsx(_components.strong,{children:`Personal API Key`}),` (e.g. flp_XXX) value in the `,_jsx(_components.strong,{children:`Bearer Token`}),` field.\nRefer to the `,_jsx(_components.a,{href:`/openapi/introduction#authentication`,children:`authentication section`}),` on our introduction page to learn how to acquire this variable and `,_jsx(_components.a,{href:`https://friendli.ai/suite/~/setting/keys`,children:`visit here`}),` to generate your API Key.`]})]})}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":"Dedicated Chat Completions","description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","deprecated":null,"version":null,"sidebarTitle":"Chat Completions","og:title":"Dedicated Chat Completions","og:description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/chat/completions","href":"/openapi/dedicated/inference/chat-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/friendliai/13360a4393f88fc7/script.js"],"openApiReferenceData":{"operation":{"tags":["Dedicated.Chat"],"summary":"Chat completions","description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","operationId":"dedicatedChatComplete","security":["40c6cd7b-1828-4150-aacd-a817dc35c2c5"],"parameters":["bbff1cb9-992f-42cd-8eed-5a6d6b95d452"],"requestBody":"8dea5d30-1f88-4e16-a750-917ba84918a9","responses":{"200":"3a32d636-adba-4689-9e8a-6976f41e9acd","422":"97cf8168-af13-4b9d-ad68-75fc96b16635"},"x-speakeasy-name-override":"complete","x-mint":{"metadata":{"title":"Dedicated Chat Completions","sidebarTitle":"Chat Completions","og:title":"Dedicated Chat Completions","description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.","og:description":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs."},"href":"/openapi/dedicated/inference/chat-completions","content":"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\n\nTo request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp_XXX) value in the **Bearer Token** field.\nRefer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key."},"method":"post","type":"path","servers":["6573dcb9-f1c7-4004-bf30-f967cb86a2a1"],"path":"/dedicated/v1/chat/completions","baseUrlOptions":["https://api.friendli.ai"],"title":"Chat completions","codeSamples":[],"requestExampleLanguages":["bash","python","javascript","go"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"(endpoint-id)","body.messages.items.0.oneOf.0.role":"system","body.messages.items.0.oneOf.0.content":"You are a helpful assistant.","body.messages.items.1.oneOf.0.role":"user","body.messages.items.1.oneOf.0.content":"Hello!"}]},"dependencies":{"parameters":{"bbff1cb9-992f-42cd-8eed-5a6d6b95d452":{"name":"X-Friendli-Team","in":"header","required":false,"schema":{"description":"ID of team to run requests as (optional parameter).","title":"X-Friendli-Team","type":"string","isRequired":false,"uniqueKey":"","typeLabel":"string"},"description":"ID of team to run requests as (optional parameter)."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"model":{"type":"string","title":"Model","description":"ID of target endpoint. If you want to send request to specific adapter, use the format \"YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE\". Otherwise, you can just use \"YOUR_ENDPOINT_ID\" alone.","examples":["(endpoint-id)"],"isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"items":{"oneOf":[{"type":"object","title":"System","required":["role","content"],"properties":{"role":{"type":"string","const":"system","title":"Role","description":"The role of the messages author.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.role","typeLabel":"string"},"content":{"type":"string","title":"Content","description":"The content of system message.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content","typeLabel":"string"},"name":{"oneOf":[{"type":"string","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.0.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.0.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.name","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.0","typeLabel":"System · object"},{"type":"object","title":"User","required":["role","content"],"properties":{"role":{"type":"string","const":"user","title":"Role","description":"The role of the message's author.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Content","description":"The content of user message, which is plain text.\n\nFor **multi-modal format**, use `object[]` type. Support for non-text input is currently in **Beta**.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Text","required":["type","text"],"properties":{"type":{"type":"string","const":"text","title":"Type","description":"The type of the message content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"string"},"text":{"type":"string","title":"Text","description":"The text content of the message.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"Audio","required":["type","audio_url"],"properties":{"type":{"type":"string","const":"audio_url","title":"Type","description":"The type of the message content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"string"},"audio_url":{"properties":{"url":{"type":"string","title":"Url","description":"The URL of the audio.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.1.audio_url.url","typeLabel":"string"}},"type":"object","required":["url"],"title":"AudioData","description":"The audio URL data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.1.audio_url","typeLabel":"AudioData · object"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Audio · object"},{"type":"object","title":"Image","required":["type","image_url"],"properties":{"type":{"type":"string","const":"image_url","title":"Type","description":"The type of the message content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"string"},"image_url":{"properties":{"url":{"type":"string","title":"Url","description":"The URL of the image.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.2.image_url.url","typeLabel":"string"}},"type":"object","required":["url"],"title":"ImageData","description":"The image URL data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.2.image_url","typeLabel":"ImageData · object"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"Image · object"},{"type":"object","title":"Video","required":["type","video_url"],"properties":{"type":{"type":"string","const":"video_url","title":"Type","description":"The type of the message content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.3.type","typeLabel":"string"},"video_url":{"properties":{"url":{"type":"string","title":"Url","description":"The URL of the video.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.3.video_url.url","typeLabel":"string"}},"type":"object","required":["url"],"title":"VideoData","description":"The video URL data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.3.video_url","typeLabel":"VideoData · object"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].oneOf.3","typeLabel":"Video · object"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX]","typeLabel":"Text · object | Audio · object | Image · object | Video · object"},"title":"Content","description":"The content of user message.\n\n**Multi-modal format** can handle not just text, but also audio, image, and video content, allowing for more complex message structures. Support for non-text input is currently in **Beta**.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1","typeLabel":"(Text · object | Audio · object | Image · object | Video · object)[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content","typeLabel":"string | (Text · object | Audio · object | Image · object | Video · object)[]"},"name":{"oneOf":[{"type":"string","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.1.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.1.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.name","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.1","typeLabel":"User · object"},{"type":"object","title":"Assistant","required":["role"],"properties":{"role":{"type":"string","const":"assistant","title":"Role","description":"The role of the messages author.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Content","description":"The content of assistant message. Required unless `tool_calls` is specified.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Content","description":"The content of assistant message. Required unless `tool_calls` is specified.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.content","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","title":"Reasoning Content","description":"The intermediate reasoning content of assistant message.","uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reasoning Content","description":"The intermediate reasoning content of assistant message.","uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning_content","typeLabel":"string | null"},"reasoning":{"oneOf":[{"type":"string","title":"Reasoning","description":"The intermediate reasoning content of assistant message. This field is a compatible option for the 'reasoning_content' field.","uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning.oneOf.0","typeLabel":"string"},{"type":"null","title":"Reasoning","description":"The intermediate reasoning content of assistant message. This field is a compatible option for the 'reasoning_content' field.","uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.reasoning","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.2.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"The name for the participant to distinguish between participants with the same role.","uniqueKey":"messages.items.[INDEX].oneOf.2.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.name","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"properties":{"id":{"type":"string","title":"Id","description":"The ID of tool call.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","const":"function","title":"Type","description":"The type of tool call.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string"},"function":{"properties":{"name":{"type":"string","title":"Name","description":"The name of function.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","title":"Arguments","description":"The arguments of function in JSON schema format to call the function.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"}},"type":"object","required":["name","arguments"],"title":"AssistantMessageToolCallFunction","description":"The function specification.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"AssistantMessageToolCallFunction · object"}},"type":"object","required":["id","type","function"],"title":"AssistantMessageToolCall","uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"AssistantMessageToolCall · object"},"title":"Tool Calls","uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.0","typeLabel":"AssistantMessageToolCall · object[]"},{"type":"null","title":"Tool Calls","uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls","typeLabel":"AssistantMessageToolCall · object[] | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.2","typeLabel":"Assistant · object"},{"type":"object","title":"Tool","required":["role","content","tool_call_id"],"properties":{"role":{"type":"string","const":"tool","title":"Role","description":"The role of the messages author.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.role","typeLabel":"string"},"content":{"type":"string","title":"Content","description":"The content of tool message that contains the result of tool calling.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content","typeLabel":"string"},"tool_call_id":{"type":"string","title":"Tool Call Id","description":"The ID of tool call corresponding to this message.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_call_id","typeLabel":"string"},"name":{"oneOf":[{"type":"string","title":"Name","description":"An optional name of the tool call corresponding to this message.","uniqueKey":"messages.items.[INDEX].oneOf.3.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"An optional name of the tool call corresponding to this message.","uniqueKey":"messages.items.[INDEX].oneOf.3.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.name","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.3","typeLabel":"Tool · object"}],"uniqueKey":"messages.items.[INDEX]","typeLabel":"System · object | User · object | Assistant · object | Tool · object"},"type":"array","title":"Messages","description":"A list of messages comprising the conversation so far.","examples":[[{"content":"You are a helpful assistant.","role":"system"},{"content":"Hello!","role":"user"}]],"isRequired":true,"uniqueKey":"messages","typeLabel":"(System · object | User · object | Assistant · object | Tool · object)[]"},"chat_template_kwargs":{"oneOf":[{"type":"object","title":"Chat Template Kwargs","description":"Additional keyword arguments supplied to the template renderer. These parameters will be available for use within the chat template.","additionalProperties":true,"uniqueKey":"chat_template_kwargs.oneOf.0","typeLabel":"Chat Template Kwargs · object"},{"type":"null","title":"Chat Template Kwargs","description":"Additional keyword arguments supplied to the template renderer. These parameters will be available for use within the chat template.","uniqueKey":"chat_template_kwargs.oneOf.1","typeLabel":"null"}],"uniqueKey":"chat_template_kwargs","typeLabel":"Chat Template Kwargs · object | null"},"eos_token":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"eos_token.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Eos Token","description":"A list of endpoint sentence tokens.","uniqueKey":"eos_token.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Eos Token","description":"A list of endpoint sentence tokens.","uniqueKey":"eos_token.oneOf.1","typeLabel":"null"}],"uniqueKey":"eos_token","typeLabel":"integer[] | null"},"frequency_penalty":{"oneOf":[{"type":"number","title":"Frequency Penalty","description":"Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled, taking into account their frequency in the preceding text. This penalization diminishes the model's tendency to reproduce identical lines verbatim.","uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number"},{"type":"null","title":"Frequency Penalty","description":"Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled, taking into account their frequency in the preceding text. This penalization diminishes the model's tendency to reproduce identical lines verbatim.","uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number | null"},"logit_bias":{"oneOf":[{"type":"object","title":"Logit Bias","description":"Accepts a JSON object that maps tokens to an associated bias value. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model.","additionalProperties":true,"uniqueKey":"logit_bias.oneOf.0","typeLabel":"Logit Bias · object"},{"type":"null","title":"Logit Bias","description":"Accepts a JSON object that maps tokens to an associated bias value. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model.","uniqueKey":"logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"logit_bias","typeLabel":"Logit Bias · object | null"},"logprobs":{"oneOf":[{"type":"boolean","title":"Logprobs","description":"Whether to return log probabilities of the output tokens or not.","uniqueKey":"logprobs.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Logprobs","description":"Whether to return log probabilities of the output tokens or not.","uniqueKey":"logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"logprobs","typeLabel":"boolean | null"},"max_tokens":{"oneOf":[{"type":"integer","title":"Max Tokens","description":"The maximum number of tokens to generate. For decoder-only models like GPT, the length of your input tokens plus `max_tokens` should not exceed the model's maximum length (e.g., 2048 for OpenAI GPT-3). For encoder-decoder models like T5 or BlenderBot, `max_tokens` should not exceed the model's maximum output length. This is similar to Hugging Face's [`max_new_tokens`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.GenerationConfig.max_new_tokens) argument.","uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Max Tokens","description":"The maximum number of tokens to generate. For decoder-only models like GPT, the length of your input tokens plus `max_tokens` should not exceed the model's maximum length (e.g., 2048 for OpenAI GPT-3). For encoder-decoder models like T5 or BlenderBot, `max_tokens` should not exceed the model's maximum output length. This is similar to Hugging Face's [`max_new_tokens`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.GenerationConfig.max_new_tokens) argument.","uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer | null"},"min_p":{"oneOf":[{"type":"number","title":"Min P","description":"A scaling factor used to determine the minimum token probability threshold. This threshold is calculated as `min_p` multiplied by the probability of the most likely token. Tokens with probabilities below this scaled threshold are excluded from sampling. Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values result in stricter filtering, while lower values allow for greater diversity. The default value of 0.0 disables filtering, allowing all tokens to be considered for sampling.","uniqueKey":"min_p.oneOf.0","typeLabel":"number"},{"type":"null","title":"Min P","description":"A scaling factor used to determine the minimum token probability threshold. This threshold is calculated as `min_p` multiplied by the probability of the most likely token. Tokens with probabilities below this scaled threshold are excluded from sampling. Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values result in stricter filtering, while lower values allow for greater diversity. The default value of 0.0 disables filtering, allowing all tokens to be considered for sampling.","uniqueKey":"min_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"min_p","typeLabel":"number | null"},"n":{"oneOf":[{"type":"integer","title":"N","description":"The number of independently generated results for the prompt. Defaults to 1. This is similar to Hugging Face's [`num_return_sequences`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.GenerationConfig.num_return_sequences) argument.","uniqueKey":"n.oneOf.0","typeLabel":"integer"},{"type":"null","title":"N","description":"The number of independently generated results for the prompt. Defaults to 1. This is similar to Hugging Face's [`num_return_sequences`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.GenerationConfig.num_return_sequences) argument.","uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer | null"},"parallel_tool_calls":{"oneOf":[{"type":"boolean","title":"Parallel Tool Calls","description":"Whether to enable parallel function calling.","uniqueKey":"parallel_tool_calls.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Parallel Tool Calls","description":"Whether to enable parallel function calling.","uniqueKey":"parallel_tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"parallel_tool_calls","typeLabel":"boolean | null"},"presence_penalty":{"oneOf":[{"type":"number","title":"Presence Penalty","description":"Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled at least once in the existing text.","uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number"},{"type":"null","title":"Presence Penalty","description":"Number between -2.0 and 2.0. Positive values penalizes tokens that have been sampled at least once in the existing text.","uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number | null"},"repetition_penalty":{"oneOf":[{"type":"number","title":"Repetition Penalty","description":"Penalizes tokens that have already appeared in the generated result (plus the input tokens for decoder-only models). Should be a positive value (1.0 means no penalty and is the default). See [Keskar et al., 2019](https://arxiv.org/abs/1909.05858) for more details. This is similar to Hugging Face's [`repetition_penalty`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.repetition_penalty) argument.","minimum":0,"exclusiveMinimum":true,"uniqueKey":"repetition_penalty.oneOf.0","typeLabel":"number"},{"type":"null","title":"Repetition Penalty","description":"Penalizes tokens that have already appeared in the generated result (plus the input tokens for decoder-only models). Should be a positive value (1.0 means no penalty and is the default). See [Keskar et al., 2019](https://arxiv.org/abs/1909.05858) for more details. This is similar to Hugging Face's [`repetition_penalty`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.repetition_penalty) argument.","uniqueKey":"repetition_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"repetition_penalty","typeLabel":"number | null"},"reasoning_effort":{"oneOf":[{"type":"string","title":"Reasoning Effort","description":"Sets how much reasoning the model does before answering. Higher values give more thorough responses but take longer. This affects reasoning models only, and the available options depend on the model.","enum":["minimal","low","medium","high","xhigh","max","ultracode"],"uniqueKey":"reasoning_effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Reasoning Effort","description":"Sets how much reasoning the model does before answering. Higher values give more thorough responses but take longer. This affects reasoning models only, and the available options depend on the model.","uniqueKey":"reasoning_effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring> | null"},"reasoning_budget":{"oneOf":[{"type":"integer","title":"Reasoning Budget","description":"Specifies a positive integer that defines a limit on the number of tokens used for internal reasoning tokens. This parameter is only effective for reasoning models.","uniqueKey":"reasoning_budget.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Reasoning Budget","description":"Specifies a positive integer that defines a limit on the number of tokens used for internal reasoning tokens. This parameter is only effective for reasoning models.","uniqueKey":"reasoning_budget.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning_budget","typeLabel":"integer | null"},"seed":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"seed.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Seed","description":"Seed to control random procedure. If nothing is given, random seed is used for sampling, and return the seed along with the generated result. When using the `n` argument, you can pass a list of seed values to control all of the independent generations.","uniqueKey":"seed.oneOf.0","typeLabel":"integer[]"},{"type":"integer","title":"Seed","description":"Seed to control random procedure. If nothing is given, random seed is used for sampling, and return the seed along with the generated result. When using the `n` argument, you can pass a list of seed values to control all of the independent generations.","uniqueKey":"seed.oneOf.1","typeLabel":"integer"},{"type":"null","title":"Seed","description":"Seed to control random procedure. If nothing is given, random seed is used for sampling, and return the seed along with the generated result. When using the `n` argument, you can pass a list of seed values to control all of the independent generations.","uniqueKey":"seed.oneOf.2","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer[] | integer | null"},"stop":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Stop","description":"When one of the stop phrases appears in the generation result, the API will stop generation. The stop phrases are excluded from the result. Defaults to empty list.","uniqueKey":"stop.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Stop","description":"When one of the stop phrases appears in the generation result, the API will stop generation. The stop phrases are excluded from the result. Defaults to empty list.","uniqueKey":"stop.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop","typeLabel":"string[] | null"},"stream":{"type":"boolean","title":"Stream","description":"Whether to stream the generation result. When set to `true`, each token is sent as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format) once generated.","default":false,"uniqueKey":"stream","typeLabel":"boolean"},"stream_options":{"oneOf":[{"type":"object","title":"StreamOptions","description":"Options related to stream.\nIt can only be used when `stream: true`.","properties":{"include_usage":{"oneOf":[{"type":"boolean","title":"Include Usage","description":"When set to `true`,\nthe number of tokens used will be included at the end of the stream result in the form of\n`\"usage\": {\"completion_tokens\": number, \"prompt_tokens\": number, \"total_tokens\": number}`.\n","uniqueKey":"stream_options.oneOf.0.include_usage.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Include Usage","description":"When set to `true`,\nthe number of tokens used will be included at the end of the stream result in the form of\n`\"usage\": {\"completion_tokens\": number, \"prompt_tokens\": number, \"total_tokens\": number}`.\n","uniqueKey":"stream_options.oneOf.0.include_usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options.oneOf.0.include_usage","typeLabel":"boolean | null"}},"uniqueKey":"stream_options.oneOf.0","typeLabel":"StreamOptions · object"},{"type":"null","description":"Options related to stream.\nIt can only be used when `stream: true`.","uniqueKey":"stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options","typeLabel":"StreamOptions · object | null"},"parse_reasoning":{"oneOf":[{"type":"boolean","title":"Parse Reasoning","description":"Parses model reasoning into `reasoning_content` while keeping the answer in `content`. Default value may vary between endpoints.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/reasoning#reasoning-parsing-with-friendli).","uniqueKey":"parse_reasoning.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Parse Reasoning","description":"Parses model reasoning into `reasoning_content` while keeping the answer in `content`. Default value may vary between endpoints.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/reasoning#reasoning-parsing-with-friendli).","uniqueKey":"parse_reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"parse_reasoning","typeLabel":"boolean | null"},"include_reasoning":{"oneOf":[{"type":"boolean","title":"Include Reasoning","description":"When `parse_reasoning=true`, include parsed reasoning (`reasoning_content`). Defaults to true.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/reasoning#reasoning-parsing-with-friendli).","uniqueKey":"include_reasoning.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Include Reasoning","description":"When `parse_reasoning=true`, include parsed reasoning (`reasoning_content`). Defaults to true.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/reasoning#reasoning-parsing-with-friendli).","uniqueKey":"include_reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"include_reasoning","typeLabel":"boolean | null"},"temperature":{"oneOf":[{"type":"number","title":"Temperature","description":"Sampling temperature. Smaller temperature makes the generation result closer to greedy, argmax (i.e., `top_k = 1`) sampling. Defaults to 1.0. This is similar to Hugging Face's [`temperature`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.temperature) argument.","uniqueKey":"temperature.oneOf.0","typeLabel":"number"},{"type":"null","title":"Temperature","description":"Sampling temperature. Smaller temperature makes the generation result closer to greedy, argmax (i.e., `top_k = 1`) sampling. Defaults to 1.0. This is similar to Hugging Face's [`temperature`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.temperature) argument.","uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number | null"},"tool_choice":{"oneOf":[{"type":"object","title":"ChatCompleteBodyToolChoice","description":"Determines the tool calling behavior of the model.\nWhen set to `none`, the model will bypass tool execution and generate a response directly.\nIn `auto` mode (the default), the model dynamically decides whether to call a tool or respond with a message.\nAlternatively, setting `required` ensures that the model invokes at least one tool before responding to the user.\nYou can also specify a particular tool by `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}`.\n","required":["type","function"],"properties":{"type":{"type":"string","const":"function","title":"Type","description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"tool_choice.oneOf.0.type","typeLabel":"string"},"function":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"tool_choice.oneOf.0.function.name","typeLabel":"string"}},"type":"object","required":["name"],"title":"ChatCompleteBodyToolChoiceFunction","isRequired":true,"uniqueKey":"tool_choice.oneOf.0.function","typeLabel":"ChatCompleteBodyToolChoiceFunction · object"}},"uniqueKey":"tool_choice.oneOf.0","typeLabel":"ChatCompleteBodyToolChoice · object"},{"type":"string","title":"Tool Choice","description":"Determines the tool calling behavior of the model.\nWhen set to `none`, the model will bypass tool execution and generate a response directly.\nIn `auto` mode (the default), the model dynamically decides whether to call a tool or respond with a message.\nAlternatively, setting `required` ensures that the model invokes at least one tool before responding to the user.\nYou can also specify a particular tool by `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}`.\n","uniqueKey":"tool_choice.oneOf.1","typeLabel":"string"}],"uniqueKey":"tool_choice","typeLabel":"ChatCompleteBodyToolChoice · object | string"},"top_k":{"oneOf":[{"type":"integer","title":"Top K","description":"Limits sampling to the top k tokens with the highest probabilities. Values range from 0 (no filtering) to the model's vocabulary size (inclusive). The default value of 0 applies no filtering, allowing all tokens.","uniqueKey":"top_k.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Top K","description":"Limits sampling to the top k tokens with the highest probabilities. Values range from 0 (no filtering) to the model's vocabulary size (inclusive). The default value of 0 applies no filtering, allowing all tokens.","uniqueKey":"top_k.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_k","typeLabel":"integer | null"},"top_logprobs":{"oneOf":[{"type":"integer","title":"Top Logprobs","description":"The number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to true if this parameter is used.","uniqueKey":"top_logprobs.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Top Logprobs","description":"The number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to true if this parameter is used.","uniqueKey":"top_logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_logprobs","typeLabel":"integer | null"},"top_p":{"oneOf":[{"type":"number","title":"Top P","description":"Keeps only the smallest set of tokens whose cumulative probabilities reach `top_p` or higher. Values range from 0.0 to 1.0 (inclusive). The default value of 1.0 includes all tokens, allowing maximum diversity.","uniqueKey":"top_p.oneOf.0","typeLabel":"number"},{"type":"null","title":"Top P","description":"Keeps only the smallest set of tokens whose cumulative probabilities reach `top_p` or higher. Values range from 0.0 to 1.0 (inclusive). The default value of 1.0 includes all tokens, allowing maximum diversity.","uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number | null"},"xtc_threshold":{"oneOf":[{"type":"number","title":"Xtc Threshold","description":"A probability threshold used to identify “top choice” tokens for exclusion in XTC (Exclude Top Choices) sampling. Tokens with probabilities at or above this threshold are considered viable candidates, and all but the least likely viable token are excluded from sampling. This option reduces the dominance of highly probable tokens while preserving some diversity by keeping the least confident “top choice.” Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values make the filtering more selective by requiring higher probabilities to trigger exclusion, while lower values apply filtering more broadly. The default value of 0.0 disables XTC filtering entirely.","uniqueKey":"xtc_threshold.oneOf.0","typeLabel":"number"},{"type":"null","title":"Xtc Threshold","description":"A probability threshold used to identify “top choice” tokens for exclusion in XTC (Exclude Top Choices) sampling. Tokens with probabilities at or above this threshold are considered viable candidates, and all but the least likely viable token are excluded from sampling. This option reduces the dominance of highly probable tokens while preserving some diversity by keeping the least confident “top choice.” Values range from 0.0 (inclusive) to 1.0 (inclusive). Higher values make the filtering more selective by requiring higher probabilities to trigger exclusion, while lower values apply filtering more broadly. The default value of 0.0 disables XTC filtering entirely.","uniqueKey":"xtc_threshold.oneOf.1","typeLabel":"null"}],"uniqueKey":"xtc_threshold","typeLabel":"number | null"},"xtc_probability":{"oneOf":[{"type":"number","title":"Xtc Probability","description":"The probability that XTC (Exclude Top Choices) filtering will be applied for each sampling decision. When XTC is triggered, high-probability tokens above the `xtc_threshold` are excluded except for the least likely viable token. This stochastic activation allows for a balance between standard sampling and creativity-boosting exclusion filtering. Values range from 0.0 (inclusive) to 1.0 (inclusive), where 0.0 means XTC is never applied, 1.0 means XTC is always applied when viable tokens exist, and intermediate values provide probabilistic activation. The default value of 0.0 disables XTC filtering.","uniqueKey":"xtc_probability.oneOf.0","typeLabel":"number"},{"type":"null","title":"Xtc Probability","description":"The probability that XTC (Exclude Top Choices) filtering will be applied for each sampling decision. When XTC is triggered, high-probability tokens above the `xtc_threshold` are excluded except for the least likely viable token. This stochastic activation allows for a balance between standard sampling and creativity-boosting exclusion filtering. Values range from 0.0 (inclusive) to 1.0 (inclusive), where 0.0 means XTC is never applied, 1.0 means XTC is always applied when viable tokens exist, and intermediate values provide probabilistic activation. The default value of 0.0 disables XTC filtering.","uniqueKey":"xtc_probability.oneOf.1","typeLabel":"null"}],"uniqueKey":"xtc_probability","typeLabel":"number | null"},"tools":{"oneOf":[{"type":"array","items":{"properties":{"type":{"type":"string","const":"function","title":"Type","description":"The type of the tool. Currently, only `function` is supported.","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].type","typeLabel":"string"},"function":{"properties":{"name":{"type":"string","title":"Name","description":"The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters","description":"The parameters the functions accepts, described as a JSON Schema object.\nTo represent a function with no parameters, use the value `{\"type\": \"object\", \"properties\": {}}`.\n","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters","typeLabel":"Parameters · object"},"description":{"oneOf":[{"type":"string","title":"Description","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.0","typeLabel":"string"},{"type":"null","title":"Description","description":"A description of what the function does, used by the model to choose when and how to call the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.description","typeLabel":"string | null"}},"type":"object","required":["name","parameters"],"title":"Function","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function","typeLabel":"Function · object"}},"type":"object","required":["type","function"],"title":"Tool","uniqueKey":"tools.oneOf.0.items.[INDEX]","typeLabel":"Tool · object"},"title":"Tools","description":"A list of tools the model may call.\nUse this to provide a list of functions the model may generate JSON inputs for.\n\n**When `tools` is specified, `min_tokens` and `response_format` fields are unsupported.**","uniqueKey":"tools.oneOf.0","typeLabel":"Tool · object[]"},{"type":"null","title":"Tools","description":"A list of tools the model may call.\nUse this to provide a list of functions the model may generate JSON inputs for.\n\n**When `tools` is specified, `min_tokens` and `response_format` fields are unsupported.**","uniqueKey":"tools.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools","typeLabel":"Tool · object[] | null"},"min_tokens":{"oneOf":[{"type":"integer","title":"Min Tokens","description":"The minimum number of tokens to generate. Default value is 0. This is similar to Hugging Face's [`min_new_tokens`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.min_new_tokens) argument.\n\n**This field is unsupported when `tools` or `response_format` is specified.**","uniqueKey":"min_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Min Tokens","description":"The minimum number of tokens to generate. Default value is 0. This is similar to Hugging Face's [`min_new_tokens`](https://huggingface.co/docs/transformers/v4.26.0/en/main_classes/text_generation#transformers.generationconfig.min_new_tokens) argument.\n\n**This field is unsupported when `tools` or `response_format` is specified.**","uniqueKey":"min_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"min_tokens","typeLabel":"integer | null"},"response_format":{"oneOf":[{"type":"object","title":"Json Schema","description":"The enforced format of the model's output.\n\nNote that the content of the output message may be truncated if it exceeds the `max_tokens`. You can check this by verifying that the `finish_reason` of the output message is `length`.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/structured-outputs).\n\n***Important***\nYou must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., `You are an API generating a valid JSON as output.`).\nOtherwise, the model may result in an unending stream of whitespace or other characters.\n\n**This field is unsupported when `tools` is specified.**\n**When `response_format` is specified, `min_tokens` field is unsupported.**","required":["type","json_schema"],"properties":{"type":{"type":"string","const":"json_schema","title":"Type","description":"The type of the response format: `json_schema`.","isRequired":true,"uniqueKey":"response_format.oneOf.0.type","typeLabel":"string"},"json_schema":{"properties":{"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The schema for the response format, described as a JSON Schema object.","isRequired":true,"uniqueKey":"response_format.oneOf.0.json_schema.schema","typeLabel":"Schema · object"}},"type":"object","required":["schema"],"title":"ResponseFormatJsonSchemaSchema","isRequired":true,"uniqueKey":"response_format.oneOf.0.json_schema","typeLabel":"ResponseFormatJsonSchemaSchema · object"}},"uniqueKey":"response_format.oneOf.0","typeLabel":"Json Schema · object"},{"type":"object","title":"Json Object","description":"The enforced format of the model's output.\n\nNote that the content of the output message may be truncated if it exceeds the `max_tokens`. You can check this by verifying that the `finish_reason` of the output message is `length`.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/structured-outputs).\n\n***Important***\nYou must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., `You are an API generating a valid JSON as output.`).\nOtherwise, the model may result in an unending stream of whitespace or other characters.\n\n**This field is unsupported when `tools` is specified.**\n**When `response_format` is specified, `min_tokens` field is unsupported.**","required":["type"],"properties":{"type":{"type":"string","const":"json_object","title":"Type","description":"The type of the response format: `json_object`.","isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"string"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"Json Object · object"},{"type":"object","title":"Regex","description":"The enforced format of the model's output.\n\nNote that the content of the output message may be truncated if it exceeds the `max_tokens`. You can check this by verifying that the `finish_reason` of the output message is `length`.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/structured-outputs).\n\n***Important***\nYou must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., `You are an API generating a valid JSON as output.`).\nOtherwise, the model may result in an unending stream of whitespace or other characters.\n\n**This field is unsupported when `tools` is specified.**\n**When `response_format` is specified, `min_tokens` field is unsupported.**","required":["type","schema"],"properties":{"type":{"type":"string","const":"regex","title":"Type","description":"The type of the response format: `regex`.","isRequired":true,"uniqueKey":"response_format.oneOf.2.type","typeLabel":"string"},"schema":{"type":"string","title":"Schema","description":"The schema of the output. Lookaheads or lookbehinds (e.g., `\\a`, `\\z`, `^`, `$`, `(?=)`, `(?!)`, `(?\u003c=...)`, `(?\u003c!...)`) are not supported. Group specials (e.g., `\\w`, `\\W`, `\\d`, `\\D`, `\\s`, `\\S`) do not support non-ASCII characters. Unicode escape patterns (e.g., `\\N`, `\\p`, `\\P`) are not supported. Additionally, conditional matching (`(?(`) and back-references can cause inefficiency.","isRequired":true,"uniqueKey":"response_format.oneOf.2.schema","typeLabel":"string"}},"uniqueKey":"response_format.oneOf.2","typeLabel":"Regex · object"},{"type":"object","title":"Text","description":"The enforced format of the model's output.\n\nNote that the content of the output message may be truncated if it exceeds the `max_tokens`. You can check this by verifying that the `finish_reason` of the output message is `length`.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/structured-outputs).\n\n***Important***\nYou must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., `You are an API generating a valid JSON as output.`).\nOtherwise, the model may result in an unending stream of whitespace or other characters.\n\n**This field is unsupported when `tools` is specified.**\n**When `response_format` is specified, `min_tokens` field is unsupported.**","required":["type"],"properties":{"type":{"type":"string","const":"text","title":"Type","description":"The type of the response format: `text`.","isRequired":true,"uniqueKey":"response_format.oneOf.3.type","typeLabel":"string"}},"uniqueKey":"response_format.oneOf.3","typeLabel":"Text · object"},{"type":"null","description":"The enforced format of the model's output.\n\nNote that the content of the output message may be truncated if it exceeds the `max_tokens`. You can check this by verifying that the `finish_reason` of the output message is `length`.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/guides/structured-outputs).\n\n***Important***\nYou must explicitly instruct the model to produce the desired output format using a system prompt or user message (e.g., `You are an API generating a valid JSON as output.`).\nOtherwise, the model may result in an unending stream of whitespace or other characters.\n\n**This field is unsupported when `tools` is specified.**\n**When `response_format` is specified, `min_tokens` field is unsupported.**","uniqueKey":"response_format.oneOf.4","typeLabel":"null"}],"uniqueKey":"response_format","typeLabel":"Json Schema · object | Json Object · object | Regex · object | Text · object | null"}},"type":"object","required":["model","messages"],"title":"DedicatedChatCompletionBody","example":{"messages":[{"content":"You are a helpful assistant.","role":"system"},{"content":"Hello!","role":"user"}],"model":"(endpoint-id)"},"uniqueKey":"","typeLabel":"DedicatedChatCompletionBody · object"},"examples":{"Example":{"title":"Example","value":{"messages":[{"content":"You are a helpful assistant.","role":"system"},{"content":"Hello!","role":"user"}],"model":"(endpoint-id)"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"3a32d636-adba-4689-9e8a-6976f41e9acd":{"description":"Chat completion, or an SSE stream when `stream` is true.","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID of the chat completion.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"choices":{"items":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of the choice in the list of generated choices.","examples":[0],"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"properties":{"role":{"type":"string","title":"Role","description":"Role of the generated message author, in this case `assistant`.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Content","description":"The contents of the assistant message.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Content","description":"The contents of the assistant message.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"properties":{"type":{"type":"string","const":"function","title":"Type","description":"The type of the tool.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string"},"id":{"type":"string","title":"Id","description":"The ID of the tool call.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"function":{"properties":{"arguments":{"type":"string","title":"Arguments","description":"The arguments for calling the function, generated by the model in JSON format.\nEnsure to validate these arguments in your code before invoking the function since the model may not always produce valid JSON.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"type":"string","title":"Name","description":"The name of the function to call.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"}},"type":"object","required":["arguments","name"],"title":"FunctionResult","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"FunctionResult · object"}},"type":"object","required":["type","id","function"],"title":"ToolCallResult","uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"ToolCallResult · object"},"title":"Tool Calls","uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0","typeLabel":"ToolCallResult · object[]"},{"type":"null","title":"Tool Calls","uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.tool_calls","typeLabel":"ToolCallResult · object[] | null"}},"type":"object","required":["role"],"title":"ChatChoiceMessage","isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"ChatChoiceMessage · object"},"finish_reason":{"type":"string","enum":["stop","length","tool_calls"],"title":"Finish Reason","description":"Termination condition of the generation. `stop` means the API returned the full chat completions generated by the model without running into any limits.\n`length` means the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n`tool_calls` means the API has generated tool calls.","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"},"logprobs":{"oneOf":[{"type":"object","title":"ChatLogprobs","properties":{"content":{"oneOf":[{"type":"array","items":{"properties":{"token":{"type":"string","title":"Token","description":"The token.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","title":"Logprob","description":"The log probability of this token.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].logprob","typeLabel":"number"},"top_logprobs":{"items":{"properties":{"token":{"type":"string","title":"Token","description":"The token.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","title":"Logprob","description":"The log probability of this token.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"type":"object","required":["token","logprob"],"title":"ChatLogprobsContentTopLogprob","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"ChatLogprobsContentTopLogprob · object"},"type":"array","title":"Top Logprobs","description":"List of the most likely tokens and their log probability, at this token position.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs","typeLabel":"ChatLogprobsContentTopLogprob · object[]"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"type":"object","required":["token","logprob","top_logprobs"],"title":"ChatLogprobsContent","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX]","typeLabel":"ChatLogprobsContent · object"},"title":"Content","description":"A list of message content tokens with log probability information.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0","typeLabel":"ChatLogprobsContent · object[]"},{"type":"null","title":"Content","description":"A list of message content tokens with log probability information.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0.content","typeLabel":"ChatLogprobsContent · object[] | null"}},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0","typeLabel":"ChatLogprobs · object"},{"type":"null","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"ChatLogprobs · object | null"}},"type":"object","required":["index","message","finish_reason"],"title":"ChatChoice","uniqueKey":"choices.items.[INDEX]","typeLabel":"ChatChoice · object"},"type":"array","title":"Choices","isRequired":true,"uniqueKey":"choices","typeLabel":"ChatChoice · object[]"},"usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt.","examples":[5],"isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the generated chat completions.","examples":[7],"isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total number of tokens used in the request (`prompt_tokens` + `completion_tokens`).","examples":[12],"isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"oneOf":[{"type":"object","title":"PromptTokensDetails","description":"Breakdown of tokens used in the prompt.","properties":{"cached_tokens":{"oneOf":[{"type":"integer","title":"Cached Tokens","description":"Cached tokens present in the prompt.","uniqueKey":"usage.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Cached Tokens","description":"Cached tokens present in the prompt.","uniqueKey":"usage.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage.prompt_tokens_details.oneOf.0.cached_tokens","typeLabel":"integer | null"}},"uniqueKey":"usage.prompt_tokens_details.oneOf.0","typeLabel":"PromptTokensDetails · object"},{"type":"null","description":"Breakdown of tokens used in the prompt.","uniqueKey":"usage.prompt_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage.prompt_tokens_details","typeLabel":"PromptTokensDetails · object | null"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"ChatUsage","isRequired":true,"uniqueKey":"usage","typeLabel":"ChatUsage · object"},"object":{"type":"string","const":"chat.completion","title":"Object","description":"The object type, which is always set to `chat.completion`.","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","title":"Created","description":"The Unix timestamp (in seconds) for when the generation completed.","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"model":{"oneOf":[{"type":"string","title":"Model","description":"The model to generate the completion. For dedicated endpoints, it returns the endpoint ID.","uniqueKey":"model.oneOf.0","typeLabel":"string"},{"type":"null","title":"Model","description":"The model to generate the completion. For dedicated endpoints, it returns the endpoint ID.","uniqueKey":"model.oneOf.1","typeLabel":"null"}],"uniqueKey":"model","typeLabel":"string | null"}},"type":"object","required":["id","choices","usage","object","created"],"title":"DedicatedChatCompleteSuccess","uniqueKey":"","typeLabel":"DedicatedChatCompleteSuccess · object"},"examples":{"Example":{"title":"Example","value":{"id":"chatcmpl-4b71d12c86d94e719c7e3984a7bb7941","model":"(endpoint-id)","object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello there, how may I assist you today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":11,"total_tokens":20},"created":1735722153}}},"exampleType":"examples"},"text/event-stream":{"schema":{"properties":{"data":{"properties":{"id":{"type":"string","title":"Id","description":"A unique ID of the chat completion.","isRequired":true,"uniqueKey":"data.id","typeLabel":"string"},"object":{"type":"string","const":"chat.completion.chunk","title":"Object","description":"The object type, which is always set to `chat.completion.chunk`.","isRequired":true,"uniqueKey":"data.object","typeLabel":"string"},"choices":{"items":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of the choice in the list of generated choices.","examples":[0],"isRequired":true,"uniqueKey":"data.choices.items.[INDEX].index","typeLabel":"integer"},"delta":{"properties":{"content":{"oneOf":[{"type":"string","title":"Content","description":"The contents of the assistant message.","uniqueKey":"data.choices.items.[INDEX].delta.content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Content","description":"The contents of the assistant message.","uniqueKey":"data.choices.items.[INDEX].delta.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].delta.content","typeLabel":"string | null"},"role":{"oneOf":[{"type":"string","title":"Role","description":"Role of the generated message author, in this case `assistant`.","uniqueKey":"data.choices.items.[INDEX].delta.role.oneOf.0","typeLabel":"string"},{"type":"null","title":"Role","description":"Role of the generated message author, in this case `assistant`.","uniqueKey":"data.choices.items.[INDEX].delta.role.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].delta.role","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"properties":{"type":{"type":"string","const":"function","title":"Type","description":"The type of the tool.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string"},"index":{"type":"integer","title":"Index","description":"The index of the tool call being generated.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].index","typeLabel":"integer"},"function":{"properties":{"arguments":{"type":"string","title":"Arguments","description":"The arguments for calling the function, generated by the model in JSON format.\nEnsure to validate these arguments in your code before invoking the function since the model may not always produce valid JSON.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"oneOf":[{"type":"string","title":"Name","description":"The name of the function to call.","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"The name of the function to call.","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string | null"}},"type":"object","required":["arguments"],"title":"StreamedFunctionResult","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"StreamedFunctionResult · object"},"id":{"oneOf":[{"type":"string","title":"Id","description":"The ID of the tool call.","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Id","description":"The ID of the tool call.","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string | null"}},"type":"object","required":["type","index","function"],"title":"StreamedToolCallResult","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"StreamedToolCallResult · object"},"title":"Tool Calls","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.0","typeLabel":"StreamedToolCallResult · object[]"},{"type":"null","title":"Tool Calls","uniqueKey":"data.choices.items.[INDEX].delta.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].delta.tool_calls","typeLabel":"StreamedToolCallResult · object[] | null"}},"type":"object","title":"StreamedChatChoiceDelta","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].delta","typeLabel":"StreamedChatChoiceDelta · object"},"logprobs":{"oneOf":[{"type":"object","title":"ChatLogprobs","properties":{"content":{"oneOf":[{"type":"array","items":{"properties":{"token":{"type":"string","title":"Token","description":"The token.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","title":"Logprob","description":"The log probability of this token.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].logprob","typeLabel":"number"},"top_logprobs":{"items":{"properties":{"token":{"type":"string","title":"Token","description":"The token.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"logprob":{"type":"number","title":"Logprob","description":"The log probability of this token.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"type":"object","required":["token","logprob"],"title":"ChatLogprobsContentTopLogprob","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"ChatLogprobsContentTopLogprob · object"},"type":"array","title":"Top Logprobs","description":"List of the most likely tokens and their log probability, at this token position.","isRequired":true,"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs","typeLabel":"ChatLogprobsContentTopLogprob · object[]"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","description":"A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"type":"object","required":["token","logprob","top_logprobs"],"title":"ChatLogprobsContent","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX]","typeLabel":"ChatLogprobsContent · object"},"title":"Content","description":"A list of message content tokens with log probability information.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0","typeLabel":"ChatLogprobsContent · object[]"},{"type":"null","title":"Content","description":"A list of message content tokens with log probability information.","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0.content","typeLabel":"ChatLogprobsContent · object[] | null"}},"uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.0","typeLabel":"ChatLogprobs · object"},{"type":"null","uniqueKey":"data.choices.items.[INDEX].logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].logprobs","typeLabel":"ChatLogprobs · object | null"},"finish_reason":{"oneOf":[{"type":"string","title":"Finish Reason","description":"Termination condition of the generation. `stop` means the API returned the full chat completions generated by the model without running into any limits.\n`length` means the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n`tool_calls` means the API has generated tool calls.","enum":["stop","length","tool_calls","null"],"uniqueKey":"data.choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Finish Reason","description":"Termination condition of the generation. `stop` means the API returned the full chat completions generated by the model without running into any limits.\n`length` means the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n`tool_calls` means the API has generated tool calls.","uniqueKey":"data.choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring> | null"}},"type":"object","required":["index","delta"],"title":"StreamedChatChoice","uniqueKey":"data.choices.items.[INDEX]","typeLabel":"StreamedChatChoice · object"},"type":"array","title":"Choices","isRequired":true,"uniqueKey":"data.choices","typeLabel":"StreamedChatChoice · object[]"},"created":{"type":"integer","title":"Created","description":"The Unix timestamp (in seconds) for when the token is sampled.","isRequired":true,"uniqueKey":"data.created","typeLabel":"integer"},"usage":{"oneOf":[{"type":"object","title":"ChatUsage","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Number of tokens in the prompt.","examples":[5],"isRequired":true,"uniqueKey":"data.usage.oneOf.0.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Number of tokens in the generated chat completions.","examples":[7],"isRequired":true,"uniqueKey":"data.usage.oneOf.0.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Total number of tokens used in the request (`prompt_tokens` + `completion_tokens`).","examples":[12],"isRequired":true,"uniqueKey":"data.usage.oneOf.0.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"oneOf":[{"type":"object","title":"PromptTokensDetails","description":"Breakdown of tokens used in the prompt.","properties":{"cached_tokens":{"oneOf":[{"type":"integer","title":"Cached Tokens","description":"Cached tokens present in the prompt.","uniqueKey":"data.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Cached Tokens","description":"Cached tokens present in the prompt.","uniqueKey":"data.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens","typeLabel":"integer | null"}},"uniqueKey":"data.usage.oneOf.0.prompt_tokens_details.oneOf.0","typeLabel":"PromptTokensDetails · object"},{"type":"null","description":"Breakdown of tokens used in the prompt.","uniqueKey":"data.usage.oneOf.0.prompt_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.usage.oneOf.0.prompt_tokens_details","typeLabel":"PromptTokensDetails · object | null"}},"uniqueKey":"data.usage.oneOf.0","typeLabel":"ChatUsage · object"},{"type":"null","uniqueKey":"data.usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.usage","typeLabel":"ChatUsage · object | null"},"model":{"oneOf":[{"type":"string","title":"Model","description":"The model to generate the completion. For dedicated endpoints, it returns the endpoint ID.","uniqueKey":"data.model.oneOf.0","typeLabel":"string"},{"type":"null","title":"Model","description":"The model to generate the completion. For dedicated endpoints, it returns the endpoint ID.","uniqueKey":"data.model.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.model","typeLabel":"string | null"}},"type":"object","required":["id","object","choices","created"],"title":"StreamedChatData","isRequired":true,"uniqueKey":"data","typeLabel":"StreamedChatData · object"}},"type":"object","required":["data"],"title":"StreamedChatResult","uniqueKey":"","typeLabel":"StreamedChatResult · object"},"examples":{"Example":{"title":"Example","value":"data: {\"id\":\"chatcmpl-4b71d12c86d94e719c7e3984a7bb7941\",\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"This\"},\"finish_reason\":null,\"logprobs\":null}],\"usage\":null,\"created\":1726294381}\n\ndata: {\"id\":\"chatcmpl-4b71d12c86d94e719c7e3984a7bb7941\",\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is\"},\"finish_reason\":null,\"logprobs\":null}],\"usage\":null,\"created\":1726294381}\n\n...\n\ndata: {\"id\":\"chatcmpl-4b71d12c86d94e719c7e3984a7bb7941\",\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\",\"logprobs\":null}],\"usage\":null,\"created\":1726294383}\n\ndata: {\"id\":\"chatcmpl-4b71d12c86d94e719c7e3984a7bb7941\",\"object\":\"chat.completion.chunk\",\"choices\":[],\"usage\":{\"prompt_tokens\":8,\"completion_tokens\":4,\"total_tokens\":12},\"created\":1726294402}\n\ndata: [DONE]\n"}},"x-speakeasy-sse-sentinel":"[DONE]","exampleType":"examples"}},"exampleType":"examples"},"97cf8168-af13-4b9d-ad68-75fc96b16635":{"description":"Unprocessable Entity","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"40c6cd7b-1828-4150-aacd-a817dc35c2c5":{"token":{"type":"http","description":"When using Friendli Suite API, you need to provide a **Personal API Key** (e.g. flp_XXX) as a Bearer token for authentication and authorization purposes.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/openapi/introduction#authentication).","scheme":"bearer","scopes":[],"schemeName":"token"}}},"servers":{"6573dcb9-f1c7-4004-bf30-f967cb86a2a1":{"url":"https://api.friendli.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","description":"When using Friendli Suite API, you need to provide a **Personal API Key** (e.g. flp_XXX) as a Bearer token for authentication and authorization purposes.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/openapi/introduction#authentication).","scheme":"bearer","scopes":[],"schemeName":"token"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"When using Friendli Suite API, you need to provide a **Personal API Key** (e.g. flp_XXX) as a Bearer token for authentication and authorization purposes.\n\nFor more detailed information, please refer [here](https://friendli.ai/docs/openapi/introduction#authentication).","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"token","name":"Authorization"}],"title":"token"}]},"originalFileLocation":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml"},"subdomain":"friendliai","siteName":"FriendliAI Docs","title":"Dedicated Chat Completions","contextualStarterQuestions":[{"_id":"69fd749768c9a4a0bb4ed265","deploymentId":"66d1620afd71f66abaace95b","questionText":"What does streaming mode return?","status":"active","generatedBy":"contextual","path":"openapi/dedicated/inference/chat-completions","createdAt":"2026-05-08T05:28:55.535Z","updatedAt":"2026-05-08T05:28:55.535Z","__v":0},{"_id":"69fd749768c9a4a0bb4ed264","deploymentId":"66d1620afd71f66abaace95b","questionText":"How do I get an API key?","status":"active","generatedBy":"contextual","path":"openapi/dedicated/inference/chat-completions","createdAt":"2026-05-08T05:28:55.535Z","updatedAt":"2026-05-08T05:28:55.535Z","__v":0},{"_id":"69fd749768c9a4a0bb4ed266","deploymentId":"66d1620afd71f66abaace95b","questionText":"How do I set up authentication?","status":"active","generatedBy":"contextual","path":"openapi/dedicated/inference/chat-completions","createdAt":"2026-05-08T05:28:55.535Z","updatedAt":"2026-05-08T05:28:55.535Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T03:11:20.170Z","gitLastModified":"2026-06-09T01:14:16.000Z","originalFileLocation":"openapi/dedicated/inference/chat-completions.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=\"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\">\u003cmeta data-mint-head name=\"application-name\" content=\"FriendliAI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_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=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Dedicated Chat Completions\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"FriendliAI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://friendliai.mintlify.site/docs/_mintlify/api/og/v2?division=Inference\u0026amp;title=Dedicated+Chat+Completions\u0026amp;description=Generate+a+model+response+from+a+list+of+messages+comprising+a+conversation.+Compatible+with+the+OpenAI+Chat+Completions+API%2C+with+support+for+streaming%2C+tool+c\u0026amp;theme=dd6dd98f885ae143c6c3d0cf\u0026amp;signature=f249f5731b68e9782bc25637666d8b854d514b776f135eff8607d334b8cad691\">\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=\"Dedicated Chat Completions\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://friendliai.mintlify.site/docs/_mintlify/api/og/v2?division=Inference\u0026amp;title=Dedicated+Chat+Completions\u0026amp;description=Generate+a+model+response+from+a+list+of+messages+comprising+a+conversation.+Compatible+with+the+OpenAI+Chat+Completions+API%2C+with+support+for+streaming%2C+tool+c\u0026amp;theme=dd6dd98f885ae143c6c3d0cf\u0026amp;signature=f249f5731b68e9782bc25637666d8b854d514b776f135eff8607d334b8cad691\">\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=\"/docs/mintlify-assets/_mintlify/favicons/friendliai/f_6Xi29vsyX4mJlf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"FriendliAI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2A62DB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/openapi/dedicated/inference/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://friendli.ai/#organization\",\"name\":\"FriendliAI Docs\",\"url\":\"https://friendli.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/friendliai/Xn-EfFlXFvptInk9/static/svgs/logo.svg?fit=max\u0026auto=format\u0026n=Xn-EfFlXFvptInk9\u0026q=85\u0026s=0a04a5dd2152a1258e6d3ce995b70eb0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://friendli.ai/docs#website\",\"name\":\"FriendliAI Docs\",\"url\":\"https://friendli.ai/docs\",\"publisher\":{\"@id\":\"https://friendli.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions#webpage\",\"url\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions\",\"name\":\"Dedicated Chat Completions\",\"description\":\"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\",\"dateModified\":\"2026-06-09T01:14:16.000Z\",\"isPartOf\":{\"@id\":\"https://friendli.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Dedicated\",\"item\":\"https://friendli.ai/docs/openapi/dedicated/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dedicated Chat Completions\",\"item\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions#apireference\",\"headline\":\"Dedicated Chat Completions\",\"name\":\"Dedicated Chat Completions\",\"description\":\"Generate a model response from a list of messages comprising a conversation. Compatible with the OpenAI Chat Completions API, with support for streaming, tool calls, and structured outputs.\",\"url\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://friendli.ai/docs/openapi/dedicated/inference/chat-completions#webpage\"},\"dateModified\":\"2026-06-09T01:14:16.000Z\",\"publisher\":{\"@id\":\"https://friendli.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://friendli.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"FriendliAI Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"FriendliAI Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/openapi/dedicated/inference/chat-completions.md","siteName":"FriendliAI Docs","nav":{"global":{"anchors":[{"anchor":"Home","icon":"home","href":"https://friendli.ai"},{"anchor":"Models","icon":"brain","href":"https://friendli.ai/models"},{"anchor":"Pricing","icon":"tag","href":"https://friendli.ai/pricing"},{"anchor":"Blog","icon":"newspaper","href":"https://friendli.ai/blog"}]},"tabs":[{"tab":"Home","hidden":true,"searchable":true,"pages":[{"title":"Home","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/introduction/overview"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/models/overview"}]},{"tab":"Reference","groups":[{"group":"API Reference","pages":[{"title":"API Reference","sidebarTitle":"Introduction","href":"/openapi/introduction"}]},{"group":"Model APIs","pages":[{"title":"Model APIs Overview","sidebarTitle":"Overview","href":"/openapi/model-apis/overview"},{"group":"Inference","pages":[{"title":"Model APIs Chat Completions","deprecated":null,"version":null,"sidebarTitle":"Chat Completions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/chat/completions","href":"/openapi/model-apis/chat-completions"},{"title":"Model APIs Responses","deprecated":null,"version":null,"sidebarTitle":"Responses","tag":"Beta","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/responses","href":"/openapi/model-apis/responses"},{"title":"Model APIs Messages","deprecated":null,"version":null,"sidebarTitle":"Messages","tag":"Beta","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/messages","href":"/openapi/model-apis/messages"},{"title":"Model APIs Chat Render","deprecated":null,"version":null,"sidebarTitle":"Chat Render","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/chat/render","href":"/openapi/model-apis/chat-render"},{"title":"Model APIs Completions","deprecated":null,"version":null,"sidebarTitle":"Completions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/completions","href":"/openapi/model-apis/completions"},{"title":"Model APIs Tokenization","deprecated":null,"version":null,"sidebarTitle":"Tokenization","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/tokenize","href":"/openapi/model-apis/tokenization"},{"title":"Model APIs Detokenization","deprecated":null,"version":null,"sidebarTitle":"Detokenization","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/detokenize","href":"/openapi/model-apis/detokenization"},{"title":"Model APIs Audio Transcriptions","deprecated":null,"version":null,"sidebarTitle":"Audio Transcriptions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /serverless/v1/audio/transcriptions","href":"/openapi/model-apis/audio-transcriptions"}]}]},{"group":"Dedicated","pages":[{"title":"Dedicated Overview","sidebarTitle":"Overview","description":"API reference for Friendli Dedicated Endpoints. Browse inference, endpoint management, chat completions, responses, messages, completions, embeddings, and image generation endpoints.","href":"/openapi/dedicated/overview"},{"group":"Inference","pages":[{"title":"Dedicated Chat Completions","deprecated":null,"version":null,"sidebarTitle":"Chat Completions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/chat/completions","href":"/openapi/dedicated/inference/chat-completions"},{"title":"Dedicated Responses","description":"Generate a model response from text or image inputs. Follows the OpenAI Responses API format, with support for streaming, function and custom tool calls, structured outputs, and reasoning controls.","deprecated":null,"version":null,"sidebarTitle":"Responses","tag":"Beta","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/responses","href":"/openapi/dedicated/inference/responses"},{"title":"Dedicated Messages","deprecated":null,"version":null,"sidebarTitle":"Messages","tag":"Beta","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/messages","href":"/openapi/dedicated/inference/messages"},{"title":"Dedicated Chat Render","deprecated":null,"version":null,"sidebarTitle":"Chat Render","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/chat/render","href":"/openapi/dedicated/inference/chat-render"},{"title":"Dedicated Completions","deprecated":null,"version":null,"sidebarTitle":"Completions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/completions","href":"/openapi/dedicated/inference/completions"},{"title":"Dedicated Embeddings","deprecated":null,"version":null,"sidebarTitle":"Embeddings","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/embeddings","href":"/openapi/dedicated/inference/embeddings"},{"title":"Dedicated Text Classification","deprecated":null,"version":null,"sidebarTitle":"Text Classification","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/classify","href":"/openapi/dedicated/inference/text-classification"},{"title":"Dedicated Tokenization","deprecated":null,"version":null,"sidebarTitle":"Tokenization","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/tokenize","href":"/openapi/dedicated/inference/tokenization"},{"title":"Dedicated Detokenization","deprecated":null,"version":null,"sidebarTitle":"Detokenization","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/detokenize","href":"/openapi/dedicated/inference/detokenization"},{"title":"Dedicated Image Generations","deprecated":null,"version":null,"sidebarTitle":"Image Generations","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/images/generations","href":"/openapi/dedicated/inference/image-generations"},{"title":"Dedicated Image Edits","deprecated":null,"version":null,"sidebarTitle":"Image Edits","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/images/edits","href":"/openapi/dedicated/inference/image-edits"},{"title":"Dedicated Audio Transcriptions","deprecated":null,"version":null,"sidebarTitle":"Audio Transcriptions","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/v1/audio/transcriptions","href":"/openapi/dedicated/inference/audio-transcriptions"}]},{"group":"Endpoint","tag":"Beta","pages":[{"title":"Dedicated List Endpoints","deprecated":null,"version":null,"sidebarTitle":"List Endpoints","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /dedicated/beta/endpoint","href":"/openapi/dedicated/endpoint/list"},{"title":"Dedicated Get Endpoint","deprecated":null,"version":null,"sidebarTitle":"Retrieve an Endpoint Specification","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /dedicated/beta/endpoint/{endpoint_id}","href":"/openapi/dedicated/endpoint/get-spec"},{"title":"Dedicated Get Endpoint Version","deprecated":null,"version":null,"sidebarTitle":"Retrieve Endpoint Version History","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /dedicated/beta/endpoint/{endpoint_id}/version","href":"/openapi/dedicated/endpoint/get-version"},{"title":"Dedicated Get Endpoint Status","deprecated":null,"version":null,"sidebarTitle":"Retrieve an Endpoint Status","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /dedicated/beta/endpoint/{endpoint_id}/status","href":"/openapi/dedicated/endpoint/get-status"},{"title":"Dedicated Create Endpoint","deprecated":null,"version":null,"sidebarTitle":"Create an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml post /dedicated/beta/endpoint","href":"/openapi/dedicated/endpoint/create"},{"title":"Dedicated Update Endpoint","deprecated":null,"version":null,"sidebarTitle":"Update an Endpoint with New Configuration","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml put /dedicated/beta/endpoint/{endpoint_id}","href":"/openapi/dedicated/endpoint/update"},{"title":"Dedicated Terminate Endpoint","deprecated":null,"version":null,"sidebarTitle":"Terminate an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml put /dedicated/beta/endpoint/{endpoint_id}/terminate","href":"/openapi/dedicated/endpoint/terminate"},{"title":"Dedicated Restart Endpoint","deprecated":null,"version":null,"sidebarTitle":"Restart an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml put /dedicated/beta/endpoint/{endpoint_id}/restart","href":"/openapi/dedicated/endpoint/restart"},{"title":"Dedicated Sleep Endpoint","deprecated":null,"version":null,"sidebarTitle":"Sleep an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml put /dedicated/beta/endpoint/{endpoint_id}/sleep","href":"/openapi/dedicated/endpoint/sleep"},{"title":"Dedicated Wake Endpoint","deprecated":null,"version":null,"sidebarTitle":"Wake Up an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml put /dedicated/beta/endpoint/{endpoint_id}/wake","href":"/openapi/dedicated/endpoint/wake"},{"title":"Dedicated Delete Endpoint","deprecated":null,"version":null,"sidebarTitle":"Delete an Endpoint","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml delete /dedicated/beta/endpoint/{endpoint_id}","href":"/openapi/dedicated/endpoint/delete"}]}]},{"group":"Administration","tag":"Beta","pages":[{"title":"Cost","deprecated":null,"version":null,"sidebarTitle":"Cost","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /v1/team/cost","href":"/openapi/administration/cost"},{"title":"Usage","deprecated":null,"version":null,"sidebarTitle":"Usage","openapi":"https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /v1/team/usage","href":"/openapi/administration/usage"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"Archive","hidden":true,"searchable":true,"pages":[{"title":"Archive","href":"/archive/container/guides/introduction"}]}]},"basePath":"","title":"Dedicated Chat Completions","deploymentId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","buildId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-Dk-T3rBp.js","dist-DYCPzQwJ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-Ku9dSkH0.js","snippetPresets-Cjez4eet.js","utils-BqNa-fnS.js","style-to-object-BY3JEAdk.js","utils-DiE92JCe.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-Bi0DpqVf.js","conditional-requirements-CFM0id0Q.js","cloneDeep-C6xnxscF.js","_Uint8Array-B7g0OYAt.js","isObject-FP1Yky1u.js","ApiExamples-Bf8Ecb5t.js","usePlaygroundInputsStore-BA942cq6.js","shallow-D0sePNkF.js","isEqual-CnnQO8sL.js","CodeSnippets-BTANoy1T.js","CodeSnippet-CTZvgJfu.js","getApiPlaygroundDisplay-BK2o1XYu.js","Page--B9YZ09u.js","DynamicMarkdown-CsgNpZb1.js","SectionHeading-C3K437Dy.js","icon-DlxjjqnB.js","MethodPill-Cr7Ib9nN.js","getPastedJson-DXo3wtHt.js","Check2Icon-ChEI-f_B.js","axios-CsQoIw0U.js","Markdown-CH4mv0N8.js","AssistantPageLink-BHjmqccN.js"]}