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

# List models from the catalogue

> Returns a paginated, filterable list of models from the gateway
catalogue.

**Note.** The response uses Prisme.ai's standard pagination envelope
(`{ items, total, page, limit }`), **not** OpenAI's
`{ object: "list", data: [...] }` shape - this endpoint is the
management catalogue, not the OpenAI-compatible model listing.

Per-org availability filter:
- No `orgSlug` query → restrict to models reachable from the current
  session (no `org_slugs` constraint, or the session's org is listed).
- `orgSlug=all` (admin only) → returns the full catalogue regardless of
  per-model `org_slugs`.
- `orgSlug=<slug>` (admin only) → impersonate that org's view.




## OpenAPI

````yaml /api-reference/llm-gateway/swagger.yml get /v1/models
openapi: 3.0.3
info:
  version: 1.0.0
  title: LLM Gateway API
  description: |
    Public REST API for the Prisme.ai LLM Gateway - OpenAI-compatible
    chat completions and embeddings, plus a managed model catalogue
    with governance overrides per organization.

    The gateway abstracts multi-provider LLM access (OpenAI, Azure OpenAI,
    Anthropic, Google Vertex, AWS Bedrock, OpenAI-compatible providers) behind
    an OpenAI-compatible request/response shape. It enforces per-tenant
    governance (allowed models, default models, quotas) and emits analytics
    events (`analytics.llm.completion`) usable for cost and carbon reporting.

    This spec documents only the public REST surface (endpoints exposed via
    Prisme.ai workspace webhooks). Internal helpers (private automations
    prefixed with `_`) and load-test mocks are not part of the public contract.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:llm-gateway/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Completions
    description: OpenAI-compatible chat completions (with optional SSE streaming).
  - name: Embeddings
    description: OpenAI-compatible text embeddings.
  - name: Models
    description: Model catalogue (CRUD + bulk replace + governance-aware listing).
  - name: Defaults
    description: >-
      Resolved default models for completions / embeddings / image generation /
      file parsing.
  - name: Test
    description: Smoke-test reachability of a model through the gateway.
paths:
  /v1/models:
    get:
      tags:
        - Models
      summary: List models from the catalogue
      description: |
        Returns a paginated, filterable list of models from the gateway
        catalogue.

        **Note.** The response uses Prisme.ai's standard pagination envelope
        (`{ items, total, page, limit }`), **not** OpenAI's
        `{ object: "list", data: [...] }` shape - this endpoint is the
        management catalogue, not the OpenAI-compatible model listing.

        Per-org availability filter:
        - No `orgSlug` query → restrict to models reachable from the current
          session (no `org_slugs` constraint, or the session's org is listed).
        - `orgSlug=all` (admin only) → returns the full catalogue regardless of
          per-model `org_slugs`.
        - `orgSlug=<slug>` (admin only) → impersonate that org's view.
      operationId: listModels
      parameters:
        - in: query
          name: limit
          schema:
            type: string
          description: Page size (capped server-side at 100, default 100).
        - in: query
          name: page
          schema:
            type: string
          description: Zero-based page index.
        - in: query
          name: type
          schema:
            type: string
            enum:
              - completion
              - embeddings
              - image_generation
          description: Filter by model type.
        - in: query
          name: enabled
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
          description: Filter by enabled flag.
        - in: query
          name: model_ids
          schema:
            type: string
          description: Comma-separated list of model IDs.
        - in: query
          name: tags
          schema:
            type: string
          description: Comma-separated list of tags (matches any).
        - in: query
          name: visible_only
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
          description: When `"true"`, exclude models with `display.hidden = true`.
        - in: query
          name: brand
          schema:
            type: string
          description: Exact match on `display.brand`.
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Case-insensitive search across `model_id`, `display.name`,
            `display.brand`.
        - in: query
          name: capability
          schema:
            type: string
            enum:
              - vision
              - audio
              - text
              - image
          description: Filter to models declaring the given capability.
        - in: query
          name: orgSlug
          schema:
            type: string
          description: |
            Admin-only override for the per-org availability filter. Use `all`
            to bypass the filter, or a slug to impersonate that org's view.
            Ignored for non-admin callers.
      responses:
        '200':
          description: Paginated list of models.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsListResponse'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ModelsListResponse:
      type: object
      description: |
        Pagination envelope used by `GET /v1/models` (Prisme.ai standard, not
        OpenAI's `{ object: "list", data: [...] }`).
      required:
        - items
        - total
        - page
        - limit
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Model'
        total:
          type: integer
          description: Total number of matching documents (ignoring pagination).
        page:
          type: integer
          description: Zero-based page index.
        limit:
          type: integer
          description: Effective page size (server-capped at 100).
    Error:
      type: object
      required:
        - error
      description: |
        Standard error envelope. `error` carries either a stable PascalCase
        identifier or a free-text label (legacy endpoints) - `code` is the
        canonical machine-readable identifier going forward.
      properties:
        error:
          type: string
          description: Stable PascalCase identifier or short error label.
        message:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: |
            Machine-readable error code. Observed values include
            `RATE_LIMITED`, `MODEL_NOT_ALLOWED`, `MODEL_NOT_FOUND`,
            `MODEL_EXISTS`, `MISSING_MODEL_ID`, `MISSING_TYPE`, `INVALID_BODY`,
            `INVALID_ITEMS`, `INVALID_DIMENSIONS`, `PAYLOAD_TOO_LARGE`,
            `METHOD_NOT_ALLOWED`, `PROVIDER_ERROR`, `PROVIDER_NO_RESPONSE`.
        details:
          description: Optional structured context (e.g. list of invalid items).
          additionalProperties: true
        status:
          type: integer
          description: HTTP status mirror, when present.
        retryAfter:
          type: integer
          description: Seconds to wait before retrying (rate-limit responses).
        provider:
          type: string
          description: Upstream provider name (provider-error responses).
        model:
          type: string
          description: Model id involved in the error (provider-error responses).
        provider_error_type:
          type: string
          description: Upstream provider's own error class name.
    Model:
      type: object
      description: |
        Model catalogue document. The catalogue is the source of truth for
        provider routing, capabilities, pricing, and per-org availability.
      required:
        - model_id
        - type
      properties:
        model_id:
          type: string
          maxLength: 128
          description: Stable identifier (matches the value sent in `request.model`).
        type:
          type: string
          maxLength: 64
          enum:
            - completion
            - embeddings
            - image_generation
          description: Model family.
        display:
          type: object
          description: Display metadata (label, brand, hidden flag).
          properties:
            name:
              type: string
            brand:
              type: string
            hidden:
              type: boolean
        capabilities:
          type: object
          description: Flags advertising what the model supports.
          properties:
            vision:
              type: boolean
            audio:
              type: boolean
            text:
              type: boolean
            image:
              type: boolean
        limits:
          type: object
          description: Provider-side limits (e.g. context window, max tokens).
          additionalProperties: true
        failover:
          type: string
          maxLength: 128
          description: Optional `model_id` to route to when the primary fails.
        region:
          type: string
          maxLength: 64
          description: Hosting region (free-text).
        dimensions:
          description: Default embedding dimensionality (embeddings models only).
        supported_dimensions:
          type: array
          description: Allowed values for the request `dimensions` parameter.
          items:
            type: number
        metrics:
          description: Free-form metrics block (latency, throughput hints, …).
        provider_config:
          type: object
          description: Provider-specific configuration (batch size, parallelism, …).
          additionalProperties: true
        pricing:
          type: object
          description: Cost configuration used to compute `usage.cost`.
          properties:
            input_per_1m_tokens:
              type: number
              format: double
            output_per_1m_tokens:
              type: number
              format: double
        tags:
          type: array
          description: Free-form tags used by the search/filter UI.
          items:
            type: string
        org_slugs:
          type: array
          description: |
            When set and non-empty, restricts the model to the listed
            organizations. Empty / missing means the model is available to all
            orgs (subject to governance overlays).
          items:
            type: string
        enabled:
          type: boolean
          description: When `false`, the model is hidden from routing.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`.
        Org API keys (`iak_*`) are **not** accepted here - they carry
        no user identity. Use the `x-prismeai-api-key` header instead
        (see `OrgApiKeyAuth`).
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`). Unlike
        `Authorization: Bearer`, this credential is **not** tied to a user
        identity - it is bound to the org and its effective access is
        defined by the scopes / permission rules attached to it (it can
        be restricted to a single project, or kept broader).
        Send as `x-prismeai-api-key: iak_...`.

````