Text Generation (Chat)
/api/v1/chat/completionsHeader Parameters
Use Bearer Token authentication. Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Model name, example input: gpt-5.3-chat deepseek-v3.2 qwen-flash qwen-flash-character qwen-plus qwen-plus-latest qwen-plus-character qwen-plus-character-ja qwen3-max qwen3-max-preview qwen3-coder-plus qwen3-coder-flash qwen3-coder-next qwen3-vl-32b-instruct qwen3-vl-32b-thinking qwen3-vl-30b-a3b-instruct qwen3-vl-30b-a3b-thinking qwen3-235b-a22b qwen3.5-plus qwen3.5-flash qwen3.5-27b qwen3.5-35b-a3b qwen3.5-122b-a10b qwen3.5-397b-a17b qwen3.6-plus qwen3.6-flash qwen3.6-35b-a3b
"gpt-5.3-chat"The context passed to the large language model, arranged in conversation order. Each element in the array is a message object.
Message Content
Message Role
"user""user" | "system" | "assistant" | "tool"Whether to enable prefix continuation. (Used for assistant role messages) Optional values: true: enable; false: disable.
After initiating Function Calling, the returned tool and input parameter information contains one or more objects and is obtained from the tool_calls field in the previous model response. (Used for assistant role messages)
The ID of the tool response.
Tool type, currently only 'function' is supported.
Tools and Input Parameter Information.
Tool Name.
Input parameter information, formatted as a JSON string.
The index of the current tool information in the tool_calls array.
The ID returned after initiating Function Calling, obtained via completion.choices[0].message.tool_calls[$index].id, is used to identify the tool corresponding to the Tool Message. (Used for tool role messages)
Whether to stream the response, default is false; false: the model returns the entire content at once after generation; true: streams the output as it is generated, returning a data chunk for each generated segment. These chunks must be read sequentially in real time to assemble the complete response.
falseConfiguration options for streaming output, effective only when stream is true.
Whether to include Token usage information in the last data chunk of the response. Valid values: true: Include; false: Do not include. During streaming output, Token usage information can only appear in the last data chunk of the response.
Output data modality, applicable only to the Qwen-Omni model. The default value is ["text"].
The voice and format of the output audio are applicable only to the Qwen-Omni model, and the modalities parameter must be set to ["text","audio"].
The timbre of the output audio.
Output audio format, only wav is supported.
Sampling temperature controls the diversity of the text generated by the model. The higher the temperature, the more diverse the generated text; conversely, the more deterministic the generated text. Value range: [0, 2)
The probability threshold for nucleus sampling, controlling the diversity of text generated by the model.
Specifies the number of candidate tokens to consider for sampling during generation. A larger value results in more random output, while a smaller value makes the output more deterministic. If set to null or greater than 100, the top_k strategy is disabled and only the top_p strategy takes effect. The value must be an integer greater than or equal to 0.
Controls the degree of content repetition during text generation.
Format of the Returned Content
The format of the returned content. Valid values: text: outputs a text response; json_object: outputs a standard JSON string; json_schema: outputs a JSON string in a specified format.
When type is json_schema, this field is required and is used to define the configuration for structured output.
The unique identifier name of the schema.
Describe the purpose of the Schema to help the model understand the semantic context of the output.
A JSON Schema-compliant object that defines the data structure of the model output.
Controls whether to force the model to strictly adhere to all constraints of the Schema.
Used to limit the maximum number of tokens in the model output.
Used to limit the maximum number of tokens in the model output.
Whether to increase the maximum pixel limit for input images to the pixel count corresponding to 16384 tokens.
The number of responses to generate, with a value range of 1-4.
3Whether to enable thinking mode when using a hybrid thinking model (which can either reason or skip reasoning before responding).
Maximum number of tokens for the thinking process.
Whether to enable the Code Interpreter feature.
Random seed.
Whether to return log probabilities of output tokens
Specify the number of candidate tokens with the highest probabilities to return at each generation step.
Used to specify stop words.
An array containing one or more tool objects for the model to invoke during Function Calling.
Tool type, currently only function is supported.
Tool Name
Tool Description
The parameter description for the tool must be a valid JSON Schema.
Tool selection strategy. Set this parameter to enforce a specific tool calling method for certain types of queries, such as always using a particular tool or disabling all tools. Available values: auto: The model autonomously selects the tool strategy. none: Set the tool_choice parameter to none if no tool calls are desired; {"type": "function", "function": {"name": "the_function_to_call"}}: To force the invocation of a specific tool, set the tool_choice parameter to {"type": "function", "function": {"name": "the_function_to_call"}}, where the_function_to_call is the name of the specified tool function.
Whether to enable parallel tool calling.
Whether to enable web search.
Web search strategies.
Whether to force-enable web search, which takes effect only when enable_search is set to true.
Search volume strategy, effective only when enable_search is true.
Whether to enable vertical search, effective only when enable_search is true.
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
The unique identifier for this request.
An array of model-generated content.
The reason the model stopped generating.
The index of the current object in the choices array.
Token probability information output by the model.
An array containing each Token and its log probability.
The text of the current Token.
The list of UTF-8 raw bytes for the current Token, used to precisely reconstruct the output content (e.g., emojis or Chinese characters).
The log probability of the current token. A return value of null indicates an extremely low probability.
The most likely candidate tokens at the current token position, with the count matching the request parameter top_logprobs.
Candidate Token text.
The list of raw UTF-8 bytes for the current Token, used to accurately reconstruct the output content (e.g., emojis or Chinese characters).
The log probability of this candidate Token. A return value of null indicates an extremely low probability.
Unix timestamp when the request was created (in seconds).
The model used for this request.
Always chat.completion.
This parameter is currently fixed to null.
This parameter is currently fixed to null.
Token consumption information for this request.
Number of tokens output by the model.
Number of input tokens.
The total number of tokens consumed is the sum of prompt_tokens and completion_tokens.
Fine-grained classification of output tokens when using the Qwen-VL model.
This parameter is currently fixed to null.
This parameter is currently fixed to null.
Number of tokens in the output text of the Qwen-VL model.
curl -X POST "https://api.ygw.ai/api/v1/chat/completions" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.3-chat", "messages": [ { "content": "Who are you?", "role": "user" } ], "stream": false, "n": 3 }'{
"id": "string",
"choices": [
{
"finish_reason": "string",
"index": 0,
"logprobs": {
"content": [
{
"token": "string",
"bytes": [
"string"
],
"logprob": 0,
"top_logprobs": [
{
"token": "string",
"bytes": [
"string"
],
"logprob": "string"
}
]
}
]
}
}
],
"created": 0,
"model": "string",
"object": "string",
"service_tier": "string",
"system_fingerprint": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {
"audio_tokens": 0,
"reasoning_tokens": 0,
"text_tokens": 0,
"01KMSGQTATRB722TFAD8XP77SD": null
}
}
}