POST
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Use the following format for authentication: Bearer <your api key>

Body

application/json
model
enum<string>
default: deepseek-ai/deepseek-vl2required

对应的模型名称。为更好的提升服务质量,我们将不定期对本服务提供的模型做相关变更,包括但不限于模型上下线,模型服务能力调整,我们会在可行的情况下以公告、消息推送等适当的方式进行通知。

Available options:
deepseek-ai/deepseek-vl2,
Qwen/Qwen2-VL-72B-Instruct,
OpenGVLab/InternVL2-26B,
Pro/Qwen/Qwen2-VL-7B-Instruct,
Pro/OpenGVLab/InternVL2-8B,
TeleAI/TeleMM
messages
object[]
required

A list of messages comprising the conversation so far.

messages.role
enum<string>
default: userrequired

The role of the messages author. Choice between: system, user, or assistant.

Available options:
user,
assistant,
system
messages.content
object[]
required

An array of content parts with a defined type, each can be of type text or image_url when passing in images. You can pass multiple images by adding multiple image_url content parts.

messages.content.type
enum<string>
default: image_urlrequired

The type of the content part.

Available options:
image_url
messages.content.image_url
object
required
messages.content.image_url.url
string
default: https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.pngrequired

Either a URL of the image or the base64 encoded image data. TeleAI/TeleMM only support the base64 encoded image data.

messages.content.image_url.detail
enum<string>
default: auto

Specifies the detail level of the image.

Available options:
auto,
low,
high
stream
boolean
default: false

If set, tokens are returned as Server-Sent Events as they are made available. Stream terminates with data: [DONE]

max_tokens
integer
default: 512

The maximum number of tokens to generate.

Required range: 1 < x < 4096
stop

Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.

temperature
number
default: 0.7

Determines the degree of randomness in the response.

top_p
number
default: 0.7

The top_p (nucleus) parameter is used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities.

top_k
number
default: 50
frequency_penalty
number
default: 0.5
n
integer
default: 1

Number of generations to return

response_format
object

An object specifying the format that the model must output.

response_format.type
string

The type of the response format.

Response

200 - application/json
id
string
choices
object[]
choices.message
object
choices.message.role
string
choices.message.content
string
choices.finish_reason
enum<string>
Available options:
stop,
eos,
length,
tool_calls
tool_calls
object[]

The tool calls generated by the model, such as function calls.

tool_calls.id
string
required

The ID of the tool call.

tool_calls.type
enum<string>
required

The type of the tool. Currently, only function is supported.

Available options:
function
tool_calls.function
object
required

The function that the model called.

tool_calls.function.name
string
required

The name of the function to call.

tool_calls.function.arguments
string
required

The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.

usage
object
usage.prompt_tokens
integer
usage.completion_tokens
integer
usage.total_tokens
integer
created
integer
model
string
object
enum<string>
Available options:
chat.completion