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

# List available models

> Returns text, chat, and embedding models in OpenAI's `Model` shape —
see [the model catalog](https://flex.ai/models) for the
complete set with pricing and capabilities.

Each entry is enriched with OpenRouter-spec metadata so
third-party catalog ingesters can consume `/v1/models` directly.
The OpenAI-compatible top-level keys (`id`, `object`, `created`,
`owned_by`) stay byte-identical for back-compat with the OpenAI Python
SDK. `owned_by` is always `"flexai"` — clients branching on the legacy
`"openai"` placeholder must update.




## OpenAPI

````yaml /inference-api/openapi.yaml get /v1/models
openapi: 3.1.0
info:
  title: FlexAI Inference API
  version: 1.0.0
  description: |
    OpenAI-compatible inference API for text, code, reasoning, vision, and
    embedding models hosted by FlexAI. Use any OpenAI SDK by pointing the
    `base_url` at this service.
  contact:
    name: FlexAI Support
    email: support@flex.ai
    url: https://docs.flex.ai/inference-api/overview
servers:
  - url: https://tokens.flex.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: Chat completions (streaming, tool use, vision).
  - name: Completions
    description: Legacy text completions.
  - name: Embeddings
    description: Generate vector embeddings for text.
  - name: Models
    description: Discover available models.
  - name: Usage
    description: Programmatic spend and quota for the calling key.
paths:
  /v1/models:
    get:
      tags:
        - Models
      summary: List available models
      description: |
        Returns text, chat, and embedding models in OpenAI's `Model` shape —
        see [the model catalog](https://flex.ai/models) for the
        complete set with pricing and capabilities.

        Each entry is enriched with OpenRouter-spec metadata so
        third-party catalog ingesters can consume `/v1/models` directly.
        The OpenAI-compatible top-level keys (`id`, `object`, `created`,
        `owned_by`) stay byte-identical for back-compat with the OpenAI Python
        SDK. `owned_by` is always `"flexai"` — clients branching on the legacy
        `"openai"` placeholder must update.
      operationId: listModels
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - object
                        - created
                        - owned_by
                      properties:
                        id:
                          type: string
                          description: |
                            Model id. Use this value as the `model` field in
                            `/v1/chat/completions`.
                        object:
                          type: string
                          enum:
                            - model
                        created:
                          type: integer
                          description: Unix timestamp.
                        owned_by:
                          type: string
                          enum:
                            - flexai
                          description: |
                            Constant `"flexai"`. (Earlier releases returned a
                            legacy `"openai"` placeholder — clients branching
                            on it must update.)
                        hugging_face_id:
                          type: string
                          description: >
                            HF Hub id when the model is published on Hugging
                            Face.
                        name:
                          type: string
                          description: Human-readable display label.
                        category:
                          type: string
                          enum:
                            - text
                            - code
                            - reasoning
                            - multimodal
                            - vision
                            - embedding
                            - image
                            - audio
                            - video
                          description: >
                            Model family / modality. Tells you which endpoint to
                            call:

                            `text`/`code`/`reasoning`/`multimodal`/`vision` →

                            `/v1/chat/completions`; `embedding` →
                            `/v1/embeddings`;

                            `image` → `/v1/images/generations`; `audio` →

                            `/v1/audio/speech` (text-to-speech) or

                            `/v1/audio/transcriptions` (speech-to-text, when

                            `input_modalities` includes `audio`); `video` →

                            `/v1/videos/generations`.
                        input_modalities:
                          type: array
                          items:
                            type: string
                            enum:
                              - text
                              - image
                              - audio
                              - file
                          description: |
                            Modalities the model accepts as input.
                        output_modalities:
                          type: array
                          items:
                            type: string
                            enum:
                              - text
                              - image
                              - video
                              - audio
                              - embedding
                          description: |
                            Modalities the model produces.
                        quantization:
                          type: string
                          enum:
                            - int4
                            - int8
                            - fp4
                            - fp6
                            - fp8
                            - fp16
                            - bf16
                            - fp32
                          description: |
                            Weight precision. Omitted for quantization schemes
                            whose precision varies per checkpoint (AWQ, GPTQ,
                            MXFP4).
                        context_length:
                          type: integer
                          description: Max context window in tokens.
                        max_output_length:
                          type: integer
                          description: Max completion length in tokens.
                        pricing:
                          type: object
                          description: |
                            Per-token USD rates as decimal strings. Emitted
                            when the model has at least one rate set.
                            Zero-rated keys (request/image/web_search/
                            internal_reasoning) are included so the object
                            always carries the full OpenRouter pricing shape.
                          properties:
                            prompt:
                              type: string
                            completion:
                              type: string
                            request:
                              type: string
                            image:
                              type: string
                            web_search:
                              type: string
                            internal_reasoning:
                              type: string
                        supported_features:
                          type: array
                          items:
                            type: string
                            enum:
                              - tools
                              - json_mode
                          description: |
                            OpenRouter feature flags. Tool-use and
                            function-calling support both surface as
                            `"tools"`.
                        supported_sampling_parameters:
                          type: array
                          items:
                            type: string
                          description: |
                            OpenAI sampling parameters the model accepts.
                            Empty array for non-chat models (embeddings,
                            TTS/STT, image/video gen, OCR) so clients reading
                            this endpoint don't ask `bge-m3` for `temperature`.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              description: |
                Stable machine-readable code for the failure. Present on
                most error paths; OMITTED on FastAPI default-validation
                bodies. Do not assume always present.
            doc_url:
              type: string
              format: uri
              description: |
                FlexAI extension. Link to the relevant dashboard / docs
                page for the failure mode (e.g. invalid key → /dashboard/keys).
                Present on auth and quota errors.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk-xxxx
      description: |
        Virtual API key. Create one from the
        [FlexAI dashboard](https://tokens.flex.ai/dashboard/keys). Pass as
        `Authorization: Bearer sk-xxxx`.

````