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

# gpt-5.1-codex-mini

> 根据对话上下文生成模型回复。



## OpenAPI

````yaml en/api-reference/model-api/openai/openapi/gpt-5-1-codex-mini/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GPT-5.1 Codex Mini
  description: 通过 Starrise AI OpenAI 兼容接口调用 OpenAI GPT-5.1 Codex Mini
  version: 1.0.0
servers:
  - url: https://ai.alad.com
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: 对话补全
      description: 根据对话上下文生成模型回复。
      operationId: createChatCompletionGPT51CodexMini
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - gpt-5.1-codex-mini
                  description: 模型 ID
                  example: gpt-5.1-codex-mini
                messages:
                  type: array
                  minItems: 1
                  description: 对话消息列表。
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: object
                  example:
                    - role: user
                      content: 你好！
                max_tokens:
                  type: integer
                  minimum: 1
                  description: 最大生成 Token 数。
                temperature:
                  type: number
                  minimum: 0
                  maximum: 2
                  default: 1
                  description: 采样温度，值越高输出越随机。
                  example: 1
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: 核采样阈值。
                frequency_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: 基于频率惩罚重复 Token。
                presence_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: 惩罚已出现过的 Token。
                stream:
                  type: boolean
                  default: false
                  description: 开启后通过 SSE 流式返回结果。
                stop:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: 触发停止生成的字符序列。
                'n':
                  type: integer
                  minimum: 1
                  default: 1
                  description: 为每条输入消息生成多少个补全选项。
                response_format:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - text
                        - json_object
                  description: '指定模型输出格式。设置 {"type": "json_object"} 可启用 JSON 模式。'
                tools:
                  type: array
                  items:
                    type: object
                  description: 模型可调用的工具列表，目前仅支持函数。
                tool_choice:
                  oneOf:
                    - type: string
                    - type: object
                  description: 控制模型调用哪个工具。
                user:
                  type: string
                  description: 代表终端用户的唯一标识符。
      responses:
        '200':
          description: 成功生成回复
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: 请求参数有误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          example: chatcmpl-abc123
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          description: Unix 时间戳
        model:
          type: string
          example: gpt-5.1-codex-mini
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    example: assistant
                  content:
                    type: string
                    example: 你好！有什么可以帮您的？
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - content_filter
                  - null
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````