---
title: "Chat Completions"
method: POST
path: "/chat/completions"
tags: ["Chat Completions"]
---

# Chat Completions

`POST /chat/completions`

Creates a model response for the given chat conversation.

## Request body

- ChatCompletionRequest
  - `model` 'deepseek-ai/DeepSeek-V2-Chat' | 'deepseek-ai/DeepSeek-Coder-V2-Instruct' | 'deepseek-ai/DeepSeek-V2.5' | 'Qwen/Qwen2.5-72B-Instruct-128K' | 'Qwen/Qwen2.5-72B-Instruct' | 'Qwen/Qwen2-VL-72B-Instruct' | 'Qwen/Qwen2.5-32B-Instruct' | 'Qwen/Qwen2.5-14B-Instruct' | 'Qwen/Qwen2.5-7B-Instruct' | 'Qwen/Qwen2.5-Math-72B-Instruct' | 'Qwen/Qwen2.5-Coder-7B-Instruct' | 'Qwen/Qwen2-72B-Instruct' | 'Qwen/Qwen2-7B-Instruct' | 'Qwen/Qwen2-1.5B-Instruct' | 'Qwen/Qwen2-57B-A14B-Instruct' | 'TeleAI/TeleChat2' | '01-ai/Yi-1.5-34B-Chat-16K' | '01-ai/Yi-1.5-9B-Chat-16K' | '01-ai/Yi-1.5-6B-Chat' | 'THUDM/chatglm3-6b' | 'THUDM/glm-4-9b-chat' | 'Vendor-A/Qwen/Qwen2-72B-Instruct' | 'Vendor-A/Qwen/Qwen2.5-72B-Instruct' | 'internlm/internlm2_5-7b-chat' | 'internlm/internlm2_5-20b-chat' | 'OpenGVLab/InternVL2-Llama3-76B' | 'OpenGVLab/InternVL2-26B' | 'meta-llama/Meta-Llama-3.1-405B-Instruct' | 'meta-llama/Meta-Llama-3.1-70B-Instruct' | 'meta-llama/Meta-Llama-3.1-8B-Instruct' | 'meta-llama/Meta-Llama-3-8B-Instruct' | 'meta-llama/Meta-Llama-3-70B-Instruct' | 'google/gemma-2-27b-it' | 'google/gemma-2-9b-it' | 'Pro/Qwen/Qwen2.5-7B-Instruct' | 'Pro/Qwen/Qwen2-7B-Instruct' | 'Pro/Qwen/Qwen2-1.5B-Instruct' | 'Pro/Qwen/Qwen2-VL-7B-Instruct' | 'Pro/01-ai/Yi-1.5-9B-Chat-16K' | 'Pro/01-ai/Yi-1.5-6B-Chat' | 'Pro/THUDM/chatglm3-6b' | 'Pro/THUDM/glm-4-9b-chat' | 'Pro/internlm/internlm2_5-7b-chat' | 'Pro/OpenGVLab/InternVL2-8B' | 'Pro/meta-llama/Meta-Llama-3-8B-Instruct' | 'Pro/meta-llama/Meta-Llama-3.1-8B-Instruct' | 'Pro/google/gemma-2-9b-it', required — The name of the model to query.
  - `messages` object[], required — A list of messages comprising the conversation so far.
    - `role` 'user' | 'assistant' | 'system', required — The role of the messages author. Choice between: system, user, or assistant.
    - `content` union, required
      - string — The contents of the message.
      - ChatCompletionRequestUserMessageContentPart[] — 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. Image input is only supported when using the `gpt-4o` model.
        - union
          - object
            - `type` 'text', required — The type of the content part.
            - `text` string, required — The text content.
          - object
            - `type` 'image_url', required — The type of the content part.
            - `image_url` object, required
              - …
  - `stream` boolean — If set, tokens are returned as Server-Sent Events as they are made available. Stream terminates with `data: [DONE]`
  - `max_tokens` integer — The maximum number of tokens to generate.
  - `stop` string[] — A list of string sequences that will truncate (stop) inference text output.
  - `temperature` number, float — Determines the degree of randomness in the response.
  - `top_p` number, float — 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, float
  - `frequency_penalty` number, float
  - `n` integer — Number of generations to return
  - `response_format` object — An object specifying the format that the model must output.
    - `type` string — The type of the response format.

## Response `200`

200

- ChatCompletionResponse
  - `id` string
  - `choices` object[]
    - `message` object
      - `role` string
      - `content` string
    - `finish_reason` 'stop' | 'eos' | 'length' | 'tool_calls'
  - `usage` UsageData
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
  - `created` integer
  - `model` string
  - `object` 'chat.completion'

## Other responses

- `400` — BadRequest
- `401` — Unauthorized
- `404` — NotFound
- `429` — RateLimit
- `503` — Overloaded
- `504` — Timeout

---

[API](https://skmtc.dev/siliconflow/apis/siliconflow-api.md) · [All operations](https://skmtc.dev/siliconflow/apis/siliconflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siliconflow/siliconflow-api/revisions/945a814800c3/schema)
