> ## 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.1-flash

> Creates a text response from text or image input using DeepSeek V4.1 Flash.



## OpenAPI

````yaml api-reference/model-api/deepseek/openapi/deepseek-v4-1-flash/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: DeepSeek V4.1 Flash
  description: >-
    DeepSeek V4.1 Flash through the AnyFast OpenAI-compatible Chat Completions
    API.
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: Create chat completion
      description: >-
        Creates a text response from text or image input using DeepSeek V4.1
        Flash.
      operationId: createChatCompletionDeepseekV41Flash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - deepseek-v4.1-flash
                  description: AnyFast model ID.
                  example: deepseek-v4.1-flash
                messages:
                  type: array
                  minItems: 1
                  description: >-
                    Conversation messages. Image content is accepted only in
                    user messages.
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                          - tool
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              oneOf:
                                - type: object
                                  required:
                                    - type
                                    - text
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - text
                                    text:
                                      type: string
                                - type: object
                                  required:
                                    - type
                                    - image_url
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - image_url
                                    image_url:
                                      type: object
                                      required:
                                        - url
                                      properties:
                                        url:
                                          type: string
                                          description: >-
                                            Public HTTP(S) URL or Base64 data URL
                                            for a JPEG, PNG, GIF, or WebP image.
                                        detail:
                                          type: string
                                          enum:
                                            - low
                                            - high
                                            - original
                                            - auto
                                          default: auto
                      reasoning_content:
                        type: string
                        nullable: true
                        description: >-
                          Prior assistant reasoning. Pass it back on subsequent
                          turns when using tools.
                      name:
                        type: string
                      tool_call_id:
                        type: string
                        description: Required for tool messages.
                      tool_calls:
                        type: array
                        items:
                          $ref: '#/components/schemas/ToolCall'
                thinking:
                  type: object
                  nullable: true
                  description: Thinking mode configuration. Thinking is enabled by default.
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                      default: enabled
                reasoning_effort:
                  type: string
                  enum:
                    - none
                    - low
                    - high
                    - max
                  default: high
                  description: >-
                    Thinking control and effort. `none` disables thinking; this
                    is a top-level field, separate from `thinking`.
                max_tokens:
                  type: integer
                  minimum: 1
                  maximum: 393216
                  description: Maximum number of generated tokens.
                response_format:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - text
                        - json_object
                      default: text
                  description: >-
                    Use `json_object` for JSON mode and explicitly request JSON
                    in the prompt.
                stop:
                  oneOf:
                    - type: string
                    - type: array
                      maxItems: 16
                      items:
                        type: string
                stream:
                  type: boolean
                  default: false
                  description: Stream partial message deltas over SSE.
                stream_options:
                  type: object
                  properties:
                    include_usage:
                      type: boolean
                      default: false
                temperature:
                  type: number
                  minimum: 0
                  maximum: 2
                  default: 1
                  description: Ignored when thinking mode is enabled.
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: >-
                    In thinking mode, values below 0.95 are treated as 0.95; in
                    non-thinking mode the effective value is 1.0.
                tools:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                      - function
                    properties:
                      type:
                        type: string
                        enum:
                          - function
                      function:
                        type: object
                        required:
                          - name
                          - parameters
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          parameters:
                            type: object
                            description: Function parameters expressed as JSON Schema.
                          strict:
                            type: boolean
                tool_choice:
                  oneOf:
                    - type: string
                      enum:
                        - none
                        - auto
                        - required
                    - type: object
                      required:
                        - type
                        - function
                      properties:
                        type:
                          type: string
                          enum:
                            - function
                        function:
                          type: object
                          required:
                            - name
                          properties:
                            name:
                              type: string
                frequency_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: >-
                    Accepted for compatibility but has no effect in thinking
                    mode.
                presence_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: >-
                    Accepted for compatibility but has no effect in thinking
                    mode.
                user_id:
                  type: string
                  maxLength: 512
                  pattern: ^[a-zA-Z0-9\-_]+$
                  description: >-
                    Stable end-user identifier for content safety and cache
                    isolation.
            examples:
              text:
                summary: Text input
                value:
                  model: deepseek-v4.1-flash
                  messages:
                    - role: user
                      content: Explain how a B-tree index accelerates database queries.
                  max_tokens: 1024
              vision:
                summary: Image input
                value:
                  model: deepseek-v4.1-flash
                  messages:
                    - role: user
                      content:
                        - type: text
                          text: Describe this image and read any visible text.
                        - type: image_url
                          image_url:
                            url: https://example.com/chart.png
              thinking:
                summary: Thinking mode
                value:
                  model: deepseek-v4.1-flash
                  messages:
                    - role: user
                      content: Find and explain the bug in this algorithm.
                  thinking:
                    type: enabled
                  reasoning_effort: high
      responses:
        '200':
          description: Chat completion created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  schemas:
    ToolCall:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - function
        function:
          type: object
          properties:
            name:
              type: string
            arguments:
              type: string
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
        - usage
      properties:
        id:
          type: string
          example: chatcmpl-example
        object:
          type: string
          enum:
            - chat.completion
        created:
          type: integer
          description: Unix timestamp in seconds.
        model:
          type: string
          example: deepseek-v4.1-flash
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - assistant
                  content:
                    type: string
                    nullable: true
                  reasoning_content:
                    type: string
                    nullable: true
                    description: Reasoning generated when thinking mode is enabled.
                  tool_calls:
                    type: array
                    nullable: true
                    items:
                      $ref: '#/components/schemas/ToolCall'
              finish_reason:
                type: string
                nullable: true
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                  - insufficient_system_resource
                  - null
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
            prompt_tokens_details:
              type: object
              properties:
                cached_tokens:
                  type: integer
            prompt_cache_hit_tokens:
              type: integer
            prompt_cache_miss_tokens:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.