VolcEngine AI icon

VolcEngine AI

Consume VolcEngine AI

Chat → Complete

AI-generated

Summary

Generate a text completion using a specified model

Inputs

  • model — The model which will generate the completion. Optional models include doubao-seed-1-6-250715, deepseek-v3-1-250821, etc.
  • messages — Add Message; collection of messages each with a role (system, user, assistant) and content.
  • simplifyOutput — Whether to return a simplified version of the response instead of the raw data.
  • options — Additional options to add.
  • requestOptions — Additional HTTP request configuration options such as proxy, timeout, and batch settings.
  • frequency_penalty — Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
  • logprobs — Whether to return log probabilities of the output tokens or not.
  • maxTokens — The maximum number of tokens to generate in the completion.
  • presence_penalty — Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
  • response_format — An object specifying the format that the model must output.
  • temperature — Controls randomness: lowering results in less random completions; as temperature approaches zero the model becomes deterministic.
  • top_logprobs — An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
  • top_p — Controls diversity via nucleus sampling; 0.5 means half of all likelihood-weighted options are considered.

Output shape

a JSON object representing the completion response

If simplifyOutput is true, the output is reduced to only the choices field; otherwise the full response body is returned. The shape may vary slightly based on selected options.

Examples

Example 1: Generate a short poem about sunrise using the doubao-seed-1-6-250715 model

model: doubao-seed-1-6-250715; messages: [{role: "user", content: "Write a short poem about sunrise"}]; simplifyOutput: true; maxTokens: 32; temperature: 0.7

Discussion