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

# DeepSeek V3

> Create a chat completion for given messages with streaming support using DeepSeek's V3 model, optimized for reasoning, mathematics, coding, and complex analytical tasks



## OpenAPI

````yaml /openapi-specs/playground/deepseek-v3.yaml POST /chat/completions
openapi: 3.1.0
info:
  title: DeepSeek V3 API
  description: >-
    DeepSeek V3 Language Model API for advanced reasoning, code generation, and
    complex problem-solving tasks
  version: 1.0.0
servers:
  - url: https://http.llm.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link
    description: Production LLM Proxy Server
security:
  - BearerAuth: []
tags:
  - name: Chat Completion
    description: DeepSeek V3 language model chat completion services
paths:
  /chat/completions:
    post:
      tags:
        - Chat Completion
      summary: Create chat completion with DeepSeek V3
      description: >-
        Create a chat completion for given messages with streaming support using
        DeepSeek's V3 model, optimized for reasoning, mathematics, coding, and
        complex analytical tasks
      operationId: createChatCompletionDeepSeekV3
      parameters:
        - in: header
          name: id
          schema:
            type: string
            default: e04b66b0-e8ac-410e-b028-b25716a91a92
          required: true
          description: Model UUID for the request (DeepSeek V3 model identifier)
          example: e04b66b0-e8ac-410e-b028-b25716a91a92
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messages:
                  type: array
                  description: Array of messages in the conversation
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                        description: The role of the message sender
                      content:
                        type: string
                        description: The content of the message
                    required:
                      - role
                      - content
                model:
                  type: string
                  description: Model identifier for DeepSeek V3
                  enum:
                    - deepseek-v3
                  default: deepseek-v3
                stream:
                  type: boolean
                  description: Whether to stream the response
                  default: false
                temperature:
                  type: number
                  description: >-
                    Sampling temperature (0.0 to 2.0). Lower values for
                    analytical tasks, higher for creative work
                  minimum: 0
                  maximum: 2
                  default: 0.7
                max_tokens:
                  type: integer
                  description: Maximum number of tokens to generate
                  minimum: 1
                  maximum: 65536
                  default: 1024
                top_p:
                  type: number
                  description: >-
                    Nucleus sampling parameter for controlling response
                    diversity
                  minimum: 0
                  maximum: 1
                  default: 1
                top_k:
                  type: integer
                  description: Top-k sampling parameter for vocabulary selection
                  minimum: 1
                  maximum: 100
                  default: 50
                stop:
                  type: array
                  description: Sequences where the API will stop generating further tokens
                  items:
                    type: string
                  maxItems: 4
                  nullable: true
                frequency_penalty:
                  type: number
                  description: Penalty for frequent tokens to reduce repetition
                  minimum: -2
                  maximum: 2
                  default: 0
                presence_penalty:
                  type: number
                  description: Penalty for new tokens to encourage topic diversity
                  minimum: -2
                  maximum: 2
                  default: 0
                repetition_penalty:
                  type: number
                  description: Penalty for repeating tokens (DeepSeek-specific parameter)
                  minimum: 0.1
                  maximum: 2
                  default: 1
                do_sample:
                  type: boolean
                  description: Whether to use sampling for generation
                  default: true
                seed:
                  type: integer
                  description: Random seed for reproducible outputs
                  nullable: true
                reasoning_mode:
                  type: boolean
                  description: Enable enhanced reasoning capabilities for complex problems
                  default: false
              required:
                - messages
                - model
            examples:
              database_query_example:
                summary: Database/SQL related query
                value:
                  model: deepseek-v3
                  messages:
                    - role: user
                      content: >-
                        How do I delete a team member from an org given user and
                        org tables?
                  stream: true
                  max_tokens: 1024
                  temperature: 0.7
                  top_p: 1
              complex_reasoning:
                summary: Complex reasoning task
                value:
                  model: deepseek-v3
                  messages:
                    - role: system
                      content: >-
                        You are an expert problem solver. Think step by step and
                        show detailed reasoning.
                    - role: user
                      content: >-
                        Prove that the square root of 2 is irrational using
                        proof by contradiction.
                  stream: false
                  temperature: 0.1
                  max_tokens: 2048
                  reasoning_mode: true
              code_generation:
                summary: Advanced code generation
                value:
                  model: deepseek-v3
                  messages:
                    - role: system
                      content: >-
                        You are an expert software engineer. Write clean,
                        efficient, and well-documented code.
                    - role: user
                      content: >-
                        Create a Python class for managing a distributed cache
                        with Redis backend
                  stream: true
                  temperature: 0.3
                  max_tokens: 3072
                  top_p: 0.9
              mathematical_problem:
                summary: Mathematical problem solving
                value:
                  model: deepseek-v3
                  messages:
                    - role: user
                      content: >-
                        Solve the differential equation dy/dx + 2y = e^(-x) with
                        initial condition y(0) = 1
                  stream: false
                  temperature: 0.1
                  max_tokens: 1536
                  reasoning_mode: true
              system_architecture:
                summary: System architecture discussion
                value:
                  model: deepseek-v3
                  messages:
                    - role: user
                      content: >-
                        Design a scalable microservices architecture for a
                        real-time chat application with 10M+ users
                  stream: true
                  temperature: 0.5
                  max_tokens: 4096
                  top_p: 0.95
      responses:
        '200':
          description: Successful chat completion
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ChatCompletionResponse'
                  - $ref: '#/components/schemas/ChatCompletionChunk'
            text/event-stream:
              schema:
                type: string
                description: Server-sent events for streaming responses
              example: >
                data:
                {"id":"chatcmpl-deepseek-abc123","object":"chat.completion.chunk","created":1699014493,"model":"deepseek-v3","choices":[{"index":0,"delta":{"content":"To
                delete"},"finish_reason":null}]}


                data:
                {"id":"chatcmpl-deepseek-abc123","object":"chat.completion.chunk","created":1699014493,"model":"deepseek-v3","choices":[{"index":0,"delta":{"content":"
                a team"},"finish_reason":null}]}
        '400':
          description: Bad Request - Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_model:
                  summary: Invalid model specified
                  value:
                    error:
                      message: Invalid model specified. Expected 'deepseek-v3'
                      type: invalid_request_error
                      code: invalid_model
                token_limit_exceeded:
                  summary: Token limit exceeded
                  value:
                    error:
                      message: max_tokens cannot exceed 65536
                      type: invalid_request_error
                      code: invalid_parameter
                      param: max_tokens
                invalid_temperature:
                  summary: Invalid temperature value
                  value:
                    error:
                      message: temperature must be between 0.0 and 2.0
                      type: invalid_request_error
                      code: invalid_parameter
                      param: temperature
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Bad Gateway - DeepSeek model service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Service Unavailable - Model temporarily overloaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatCompletionResponse:
      type: object
      description: Response for non-streaming chat completion
      properties:
        id:
          type: string
          description: Unique identifier for the completion
          example: chatcmpl-deepseek-abc123
        object:
          type: string
          enum:
            - chat.completion
          description: Object type
          example: chat.completion
        created:
          type: integer
          description: Unix timestamp of when the completion was created
          example: 1699014493
        model:
          type: string
          description: The model used for completion
          example: deepseek-v3
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                description: Index of the choice
                example: 0
              message:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - assistant
                    description: Role of the message sender
                    example: assistant
                  content:
                    type: string
                    description: Generated text content
                    example: >-
                      To delete a team member from an organization, you'll need
                      to handle the relationship between user and org tables.
                      Here's a typical approach:


                      ```sql

                      -- Option 1: Delete from junction table

                      DELETE FROM user_org_memberships 

                      WHERE user_id = ? AND org_id = ?;


                      -- Option 2: Update user record

                      UPDATE users 

                      SET org_id = NULL 

                      WHERE user_id = ? AND org_id = ?;

                      ```


                      The exact implementation depends on your database schema
                      design.
                required:
                  - role
                  - content
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                description: Reason for finishing the generation
                example: stop
            required:
              - index
              - message
              - finish_reason
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
              description: Number of tokens in the prompt
              example: 18
            completion_tokens:
              type: integer
              description: Number of tokens in the completion
              example: 156
            total_tokens:
              type: integer
              description: Total number of tokens used
              example: 174
            reasoning_tokens:
              type: integer
              description: Additional tokens used for reasoning (if reasoning_mode enabled)
              example: 0
              nullable: true
          required:
            - prompt_tokens
            - completion_tokens
            - total_tokens
        system_fingerprint:
          type: string
          description: System fingerprint for the model version
          example: deepseek-v3-20241201
          nullable: true
    ChatCompletionChunk:
      type: object
      description: Response chunk for streaming chat completion
      properties:
        id:
          type: string
          description: Unique identifier for the completion
          example: chatcmpl-deepseek-abc123
        object:
          type: string
          enum:
            - chat.completion.chunk
          description: Object type
          example: chat.completion.chunk
        created:
          type: integer
          description: Unix timestamp of when the completion was created
          example: 1699014493
        model:
          type: string
          description: The model used for completion
          example: deepseek-v3
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                description: Index of the choice
                example: 0
              delta:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - assistant
                    description: Role of the message sender (only in first chunk)
                    example: assistant
                  content:
                    type: string
                    description: Generated text content chunk
                    nullable: true
                    example: To delete a team
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                description: Reason for finishing the generation (only in last chunk)
                nullable: true
                example: null
            required:
              - index
              - delta
        system_fingerprint:
          type: string
          description: System fingerprint for the model version
          example: deepseek-v3-20241201
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message
              example: Invalid model specified
            type:
              type: string
              description: Error type classification
              example: invalid_request_error
              enum:
                - invalid_request_error
                - authentication_error
                - rate_limit_error
                - server_error
                - model_error
            code:
              type: string
              description: Specific error code
              example: invalid_model
            param:
              type: string
              description: Parameter that caused the error (if applicable)
              example: model
              nullable: true
          required:
            - message
            - type
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for authentication - Use your API token as the Bearer token

````