> ## 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.

# Retrieve a model

> Returns one entry of the `GET /v1/models` catalog — the same object,
with the same fields and the same values, that the list returns for
that model to the same caller. The OpenAI SDK's
`client.models.retrieve("<id>")` calls this.

`model` may be the model's `id` or any of its `aliases`; the entry
returned always carries the canonical `id`. A model that is not in
your live catalog right now — unknown, retired, scaled down, or not
available to your account — returns `404` with
`code: "model_not_found"`. Responses carry the same `Cache-Control`
and `X-FlexAI-Models-Degraded` headers as the list.




## OpenAPI

````yaml /inference-api/openapi.yaml get /v1/models/{model}
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://api.flex.ai
    description: Production
  - url: https://tokens.flex.ai
    description: Production (legacy host, still supported)
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/{model}:
    get:
      tags:
        - Models
      summary: Retrieve a model
      description: |
        Returns one entry of the `GET /v1/models` catalog — the same object,
        with the same fields and the same values, that the list returns for
        that model to the same caller. The OpenAI SDK's
        `client.models.retrieve("<id>")` calls this.

        `model` may be the model's `id` or any of its `aliases`; the entry
        returned always carries the canonical `id`. A model that is not in
        your live catalog right now — unknown, retired, scaled down, or not
        available to your account — returns `404` with
        `code: "model_not_found"`. Responses carry the same `Cache-Control`
        and `X-FlexAI-Models-Degraded` headers as the list.
      operationId: retrieveModel
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
          description: Model `id` or alias.
      responses:
        '200':
          description: Successful response
          headers:
            Cache-Control:
              schema:
                type: string
              description: private, max-age=30
            X-FlexAI-Models-Degraded:
              schema:
                type: string
                enum:
                  - no-readiness-signal
              description: See `GET /v1/models`.
          content:
            application/json:
              schema:
                $ref: 7ad0236b-212c-4fe8-81b9-093f3079cdad
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found (e.g., unknown model or job id).
      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`.

````