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

# List the user's Codex models

> Forward Codex model discovery using the caller's ChatGPT identity after Aixy project authentication and subscription-connection admission. Returns the Codex-native catalog and model IDs, without provider prefixes, filtered by effective model blocks while preserving remaining native metadata. No catalog cache is shared across users. This catalog does not populate the shared Aixy Models or Playground inventory.



## OpenAPI

````yaml /openapi.json get /backend-api/codex/models
openapi: 3.1.0
info:
  title: Aixy Inference API
  version: 0.1.0
  description: >-
    Route requests to configured AI providers through OpenAI- and
    Anthropic-compatible APIs. Aixy applies project access, model policies,
    guardrails, routing, budgets, and usage attribution before forwarding
    inference traffic. Create connections, API keys and policies in the Aixy
    dashboard. The management API is a dashboard service and is not a public
    integration contract. Native provider features depend on the selected model
    and connection; translated requests support the documented conversation and
    function-tool subset. Unsupported combinations return explicit errors.
    Examples use illustrative model IDs; select an ID available to your project.
servers:
  - url: https://api.aixy-gateway.com
    description: Aixy production gateway
security: []
tags:
  - name: OpenAI
    description: OpenAI-compatible conversations, function tools and incremental streams.
  - name: Anthropic
    description: Anthropic-compatible messages and provider-native input token counting.
  - name: Decisions
    description: Typed, non-streaming classification and scoring inference.
  - name: Models
    description: Discover the models available to your project API key.
  - name: Codex
    description: Use the official Codex client with each user's ChatGPT subscription.
paths:
  /backend-api/codex/models:
    get:
      tags:
        - Codex
      summary: List the user's Codex models
      description: >-
        Forward Codex model discovery using the caller's ChatGPT identity after
        Aixy project authentication and subscription-connection admission.
        Returns the Codex-native catalog and model IDs, without provider
        prefixes, filtered by effective model blocks while preserving remaining
        native metadata. No catalog cache is shared across users. This catalog
        does not populate the shared Aixy Models or Playground inventory.
      operationId: list_codex_subscription_models
      parameters:
        - $ref: '#/components/parameters/XRequestId'
        - $ref: '#/components/parameters/XAixySessionId'
        - name: ChatGPT-Account-ID
          in: header
          required: false
          schema:
            type: string
          description: >-
            Account/workspace selected by Codex; preserved for OpenAI
            validation. It does not select or authorize an Aixy tenant.
        - name: client_version
          in: query
          required: false
          schema:
            type: string
          description: Codex client version; forwarded unchanged.
      responses:
        '200':
          description: The user's native Codex model catalog.
          headers:
            x-request-id:
              description: >-
                Aixy request identifier for correlation with Activity and
                support.
              schema:
                type: string
              example: req_example_01
            ETag:
              schema:
                type: string
              description: Upstream validator; omitted after policy filtering.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodexModelsResponse'
        '400':
          $ref: '#/components/responses/GatewayError'
        '401':
          $ref: '#/components/responses/GatewayError'
        '403':
          $ref: '#/components/responses/GatewayError'
        '404':
          $ref: '#/components/responses/GatewayError'
        '408':
          $ref: '#/components/responses/GatewayError'
        '413':
          $ref: '#/components/responses/GatewayError'
        '429':
          $ref: '#/components/responses/GatewayError'
        '502':
          $ref: '#/components/responses/GatewayError'
        '503':
          $ref: '#/components/responses/GatewayError'
        '504':
          $ref: '#/components/responses/GatewayError'
        default:
          $ref: '#/components/responses/NativeProviderError'
      security:
        - CodexGatewayKey: []
          CodexChatGPTToken: []
components:
  parameters:
    XRequestId:
      name: X-Request-ID
      in: header
      required: false
      description: Optional caller-generated request identifier for end-to-end tracing.
      schema:
        type: string
        maxLength: 255
    XAixySessionId:
      name: X-Aixy-Session-ID
      in: header
      required: false
      description: >-
        Optional opaque conversation identifier recorded in Activity metadata.
        Reuse it for every call in a conversation. Sessions are isolated by
        organization, project, user and API key. Use no personal data or
        secrets. Invalid values are ignored. The header is not forwarded, grants
        no permissions and does not change routing affinity.
      schema:
        type: string
        minLength: 1
        maxLength: 128
        pattern: ^[A-Za-z0-9._:-]+$
        example: conversation-82
  schemas:
    CodexModelsResponse:
      type: object
      required:
        - models
      properties:
        models:
          type: array
          items:
            type: object
            required:
              - slug
              - display_name
            properties:
              slug:
                type: string
              display_name:
                type: string
            additionalProperties: true
          description: >-
            Native Codex catalog entries including upstream capabilities,
            instructions and migration metadata. Forwarded without conversion to
            the generic OpenAI data[] catalog.
      additionalProperties: true
    InferenceErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
            code:
              type:
                - string
                - 'null'
            type:
              type:
                - string
                - 'null'
            param:
              type:
                - string
                - integer
                - 'null'
            details:
              type:
                - object
                - 'null'
              additionalProperties: true
          additionalProperties: true
        type:
          type: string
        request_id:
          type: string
      additionalProperties: true
  responses:
    GatewayError:
      description: >-
        The gateway or upstream provider rejected the request. Gateway codes
        identify invalid_request or unsupported_feature (400),
        invalid_gateway_api_key (401), access or policy denials (403),
        unavailable models (404), request deadlines (408/504), body limits
        (413), hard-budget admission failures (424), and upstream or gateway
        availability failures (502/503). Native provider error details may
        differ.
      headers:
        x-request-id:
          description: Aixy request identifier for correlation with Activity and support.
          schema:
            type: string
          example: req_example_01
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InferenceErrorResponse'
          example:
            error:
              code: invalid_gateway_api_key
              message: Gateway API key is invalid or revoked
    NativeProviderError:
      description: >-
        A native provider may return another error status and its original
        payload. After streaming starts, failures can arrive inside the SSE
        stream instead of changing the HTTP status. Handle both HTTP errors and
        protocol error events.
      headers:
        x-request-id:
          description: Aixy request identifier for correlation with Activity and support.
          schema:
            type: string
          example: req_example_01
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
  securitySchemes:
    CodexGatewayKey:
      type: apiKey
      in: header
      name: X-Gateway-Key
      description: >-
        The caller's personal, project-scoped Aixy key. Aixy validates and
        removes this header before forwarding. It does not replace the ChatGPT
        token.
    CodexChatGPTToken:
      type: http
      scheme: bearer
      description: >-
        The user's ChatGPT access token supplied by the official Codex client.
        Forwarded only to the fixed Codex backend; never stored as a connection.

````

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