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

# List models

> Returns every model with its price per message and whether your plan can use it.



## OpenAPI

````yaml /openapi.yaml get /models
openapi: 3.0.3
info:
  title: ReyGrid API
  version: 1.0.3
  description: |
    ReyGrid API

    ## Persistent user conversations

    If you want to build a separate conversation system for each user,
    build a wrapper layer around the ReyGrid API.

    The wrapper should manage the application's own user IDs and map them
    to ReyGrid conversations.

    The wrapper is responsible for:
    - Managing and identifying users.
    - Storing the relationship between the application's userId and
      ReyGrid conversationId.
    - Persisting conversation IDs in the application's own database.
    - Reusing the stored conversationId when the same user continues
      a conversation.
    - Verifying that conversation IDs belong to the expected user before
      using them.

    ReyGrid's userId can also be used as a stable identifier for persistent
    conversations. However, if the application requires its own user and
    conversation management, it should maintain this mapping in its own
    database.
servers:
  - url: https://reygrid.com/api/v1
security: []
paths:
  /models:
    get:
      summary: List models
      description: >-
        Returns every model with its price per message and whether your plan can
        use it.
      operationId: listModels
      responses:
        '200':
          description: Models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsResponse'
              example:
                success: true
                models:
                  - id: gpt-4o-mini-2024-07-18
                    name: GPT-4o mini
                    provider: OpenAI
                    pricing: 0.5
                    available: true
                  - id: claude-sonnet-5-5
                    name: Claude Sonnet 5.5
                    provider: Anthropic
                    pricing: 1.5
                    available: false
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl https://reygrid.com/api/v1/models \
              -H "Authorization: Bearer $REYGRID_API_KEY"
        - lang: python
          label: Python SDK
          source: |-
            from reygrid import ReyGrid

            client = ReyGrid(api_key="YOUR_API_KEY")

            for model in client.list_models().models:
                print(model.id, model.pricing, "available" if model.available else "upgrade needed")
        - lang: javascript
          label: TypeScript SDK
          source: |-
            import { ReyGrid } from "reygrid";

            const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });

            const { models } = await client.listModels();
            const usable = models.filter((m) => m.available);
components:
  schemas:
    ModelsResponse:
      type: object
      properties:
        success:
          type: boolean
        models:
          type: array
          items:
            $ref: '#/components/schemas/Model'
    Model:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        provider:
          type: string
        pricing:
          type: number
          description: Credits per message.
        available:
          type: boolean
          description: Whether your plan can use the model.
    AuthErrorResponse:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          example: Unauthorized
        code:
          type: string
          example: AUTH_REQUIRED
  responses:
    Unauthorized:
      description: API key is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthErrorResponse'
          example:
            error: Unauthorized
            code: AUTH_REQUIRED
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API-Key
      description: ReyGrid API key sent as a Bearer token.

````

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