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

# Native OpenAI Format

> Creates model responses based on conversation history. Supports both streaming and non-streaming responses. 

Compatible with the OpenAI Chat Completions API.

<Tip>
  This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [OpenAI Docs](https://platform.openai.com/docs/api-reference/chat/create).
</Tip>


## OpenAPI

````yaml api-reference/openapi.json post /v1/chat/completions
openapi: 3.0.1
info:
  title: AI model interface
  description: ''
  version: 1.0.0
servers:
  - url: https://api.ai.cc
security:
  - BearerAuth: []
tags:
  - name: Get Model List
  - name: Text completion
  - name: Translator
  - name: OpenAI Chat
  - name: OpenAI Response
  - name: Claude Messages
  - name: Gemini Generate Content
  - name: Video Task
  - name: Sora Video Task
paths:
  /v1/chat/completions:
    post:
      tags:
        - OpenAI Chat
      summary: Create a chat conversation
      description: >-
        Creates model responses based on conversation history. Supports both
        streaming and non-streaming responses. 


        Compatible with the OpenAI Chat Completions API.
      operationId: createChatCompletion
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              Default:
                summary: examples
                value:
                  model: gpt-4
                  messages:
                    - role: developer
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello!
        required: true
      responses:
        '200':
          description: Successfully created response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
          headers: {}
        '400':
          description: Incorrect request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
        '429':
          description: Request frequency limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: model ID
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          description: message list
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          description: 'What sampling temperature to use, between 0 and 2. '
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          description: >-
            An alternative to sampling with temperature, called nucleus
            sampling, where the model considers the results of the tokens with
            top_p probability mass. 
        'n':
          type: integer
          minimum: 1
          default: 1
          description: How many chat completion choices to generate for each input message.
        stream:
          type: boolean
          default: false
          description: >-
            If set to true, the model response data will be streamed to the
            client as it is generated using server-sent events.
        stream_options:
          type: object
          properties:
            include_usage:
              type: boolean
        stop:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: Up to 4 sequences where the API will stop generating further tokens.
        max_tokens:
          type: integer
          description: >-
            The maximum number of tokens that can be generated in the chat
            completion. This value can be used to control costs for text
            generated via API.
        max_completion_tokens:
          type: integer
          description: >-
            An upper bound for the number of tokens that can be generated for a
            completion, including visible output tokens and reasoning tokens.
        presence_penalty:
          type: number
          minimum: -2
          maximum: 2
          default: 0
          description: >-
            Number between -2.0 and 2.0. Positive values penalize new tokens
            based on whether they appear in the text so far, increasing the
            model's likelihood to talk about new topics.
        frequency_penalty:
          type: number
          minimum: -2
          maximum: 2
          default: 0
          description: >-
            Number between -2.0 and 2.0. Positive values penalize new tokens
            based on their existing frequency in the text so far, decreasing the
            model's likelihood to repeat the same line verbatim.
        logit_bias:
          type: object
          additionalProperties:
            type: number
          properties: {}
        user:
          type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          oneOf:
            - type: string
              enum:
                - none
                - auto
                - required
            - type: object
              properties:
                type:
                  type: string
                function:
                  type: object
                  properties:
                    name:
                      type: string
        response_format:
          $ref: '#/components/schemas/ResponseFormat'
        seed:
          type: integer
        reasoning_effort:
          type: string
          enum:
            - low
            - medium
            - high
        modalities:
          type: array
          items:
            type: string
            enum:
              - text
              - audio
        audio:
          type: object
          properties:
            voice:
              type: string
            format:
              type: string
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/Message'
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - tool_calls
                  - content_filter
        usage:
          $ref: '#/components/schemas/Usage'
        system_fingerprint:
          type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: error message
            type:
              type: string
              description: error type
            param:
              type: string
              description: error param
              nullable: true
            code:
              type: string
              description: code
              nullable: true
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
            - developer
          description: role
        content:
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/MessageContent'
          description: content
        name:
          type: string
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
        reasoning_content:
          type: string
    Tool:
      type: object
      properties:
        type:
          type: string
          example: function
        function:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
            parameters:
              type: object
              properties: {}
    ResponseFormat:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
            - json_object
            - json_schema
        json_schema:
          type: object
          properties: {}
    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
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            image_tokens:
              type: integer
        completion_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
            audio_tokens:
              type: integer
            reasoning_tokens:
              type: integer
    MessageContent:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
            - input_audio
            - file
            - video_url
        text:
          type: string
        image_url:
          type: object
          properties:
            url:
              type: string
              description: image URL or base64
            detail:
              type: string
              enum:
                - low
                - high
                - auto
        input_audio:
          type: object
          properties:
            data:
              type: string
              description: Base64 encode audio
            format:
              type: string
              enum:
                - wav
                - mp3
        file:
          type: object
          properties:
            filename:
              type: string
            file_data:
              type: string
            file_id:
              type: string
        video_url:
          type: object
          properties:
            url:
              type: string
    ToolCall:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: function
        function:
          type: object
          properties:
            name:
              type: string
            arguments:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        Authentication is done using Bearer Token. 
        Format: `Authorization: Bearer sk-xxxxxx`

````