> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# deepseek-v4-pro

> Creates a model response for the given chat conversation.



## OpenAPI

````yaml api-reference/model-api/deepseek/openapi/deepseek-v4-pro/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: DeepSeek V4 Pro
  description: DeepSeek V4 Pro via Anyfast OpenAI-compatible API
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: Chat Completion
      description: Creates a model response for the given chat conversation.
      operationId: createChatCompletionDeepseekV4Pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - deepseek-v4-pro
                  description: Model ID
                  example: deepseek-v4-pro
                messages:
                  type: array
                  minItems: 1
                  description: A list of messages comprising the conversation so far.
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                          - tool
                      content:
                        type: string
                      name:
                        type: string
                        description: >-
                          Participant name for distinguishing between same-role
                          participants.
                      prefix:
                        type: boolean
                        description: >-
                          If true, the model will treat this message as a prefix
                          to continue.
                      tool_call_id:
                        type: string
                        description: >-
                          Required for tool messages. The tool call this message
                          responds to.
                  example:
                    - role: user
                      content: Hello!
                thinking:
                  type: object
                  nullable: true
                  description: Enable or disable thinking mode.
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                      description: '`enabled` to turn on thinking mode.'
                    reasoning_effort:
                      type: string
                      enum:
                        - high
                        - max
                        - low
                        - medium
                      description: Controls reasoning effort.
                max_tokens:
                  type: integer
                  minimum: 1
                  description: The maximum number of tokens to generate.
                response_format:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - text
                        - json_object
                      default: text
                  description: 'Set to `{"type": "json_object"}` to enable JSON mode.'
                stop:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: >-
                    Sequences where the model will stop generating further
                    tokens. Up to 16 strings.
                stream:
                  type: boolean
                  default: false
                  description: If true, stream partial message deltas using SSE.
                stream_options:
                  type: object
                  description: Options for streaming. Only valid when stream is true.
                  properties:
                    include_usage:
                      type: boolean
                      description: >-
                        If true, include usage stats in the final streaming
                        chunk.
                temperature:
                  type: number
                  minimum: 0
                  maximum: 2
                  default: 1
                  description: Sampling temperature. Higher values make output more random.
                  example: 1
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: Nucleus sampling threshold.
                tools:
                  type: array
                  description: >-
                    A list of tools the model may call. Currently only functions
                    are supported.
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - function
                      function:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                            description: The name of the function to call.
                          description:
                            type: string
                            description: A description of what the function does.
                          parameters:
                            type: object
                            description: >-
                              The parameters the function accepts, described as
                              a JSON Schema object.
                          strict:
                            type: boolean
                            description: If true, enables strict mode for the function.
                tool_choice:
                  oneOf:
                    - type: string
                      enum:
                        - none
                        - auto
                        - required
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - function
                        function:
                          type: object
                          required:
                            - name
                          properties:
                            name:
                              type: string
                  description: >-
                    Controls which tool is called. `none`, `auto`, `required`,
                    or a specific function.
                frequency_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: Deprecated by DeepSeek. Passed through but has no effect.
                presence_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: Deprecated by DeepSeek. Passed through but has no effect.
                user_id:
                  type: string
                  maxLength: 512
                  pattern: ^[a-zA-Z0-9\-_]+$
                  description: Custom user ID for content safety and KVCache isolation.
      responses:
        '200':
          description: Completion generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      code:
                        type: string
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  schemas:
    ChatCompletion:
      type: object
      properties:
        id:
          type: string
          example: chatcmpl-abc123
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          description: Unix timestamp
        model:
          type: string
          example: deepseek-v4-pro
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    example: assistant
                  content:
                    type: string
                    nullable: true
                    example: Hello! How can I help you today?
                  reasoning_content:
                    type: string
                    nullable: true
                    description: Reasoning content from thinking mode.
                  tool_calls:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - function
                        function:
                          type: object
                          properties:
                            name:
                              type: string
                            arguments:
                              type: string
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                  - insufficient_system_resource
                  - null
              matched_stop:
                type: string
                nullable: true
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
            prompt_tokens_details:
              type: object
              nullable: true
              properties:
                cached_tokens:
                  type: integer
                audio_tokens:
                  type: integer
                text_tokens:
                  type: integer
            completion_tokens_details:
              type: object
              properties:
                reasoning_tokens:
                  type: integer
                accepted_prediction_tokens:
                  type: integer
                rejected_prediction_tokens:
                  type: integer
        system_fingerprint:
          type: string
          nullable: true
          description: Backend configuration fingerprint.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication via Bearer token. Create an API Key in the Anyfast
        console and pass it as `Bearer YOUR_API_KEY` in the Authorization
        header.

````