xAI

xAI Models API

The Models API from xAI — 2 operation(s) for models.

Operations 2

GET /v1/models List all models available to the authenticating API key with minimalized… #
GET /v1/models/{model_id} Get minimalized information about a model with its model_id #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/xai:xai-models-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

xai-models-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: xAI's REST Models API
  description: REST API for xAI compatible with other providers.
  license:
    name: ''
  version: 1.0.0
tags:
- name: Models
paths:
  /v1/models:
    get:
      tags:
      - Models
      summary: List all models available to the authenticating API key with minimalized…
      operationId: handle_models_list_request
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListModelsResponse'
              example:
                data:
                - id: grok-4-0709
                  created: 1752019200
                  object: model
                  owned_by: xai
                - id: grok-code-fast-1
                  created: 1755993600
                  object: model
                  owned_by: xai
                - id: grok-3
                  created: 1743724800
                  object: model
                  owned_by: xai
                - id: grok-3-mini
                  created: 1743724800
                  object: model
                  owned_by: xai
                - id: grok-2-image-1212
                  created: 1736726400
                  object: model
                  owned_by: xai
                - id: grok-2-vision-1212
                  created: 1733961600
                  object: model
                  owned_by: xai
                object: list
        '400':
          description: Bad request. The request is invalid or an invalid API key is provided.
      security:
      - bearerAuth: []
  /v1/models/{model_id}:
    get:
      tags:
      - Models
      summary: Get minimalized information about a model with its model_id
      operationId: handle_model_get_request
      parameters:
      - name: model_id
        in: path
        description: ID of the model to get.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
              example:
                id: latest
                created: 1743724800
                object: model
                owned_by: xai
        '400':
          description: Bad request. The request is invalid or an invalid API key is provided.
        '404':
          description: Model not found
      security:
      - bearerAuth: []
components:
  schemas:
    Model:
      type: object
      description: Same as `LanguageModel` but fully compliant with the OpenAI API.
      required:
      - id
      - created
      - object
      - owned_by
      properties:
        created:
          type: integer
          format: int64
          description: Model creation time in Unix timestamp.
        id:
          type: string
          description: Model ID. Obtainable from <https://console.x.ai/team/default/models> or <https://docs.x.ai/docs/models>.
        object:
          type: string
          description: The object type, which is always `"model"`.
        owned_by:
          type: string
          description: Owner of the model.
    ListModelsResponse:
      type: object
      required:
      - data
      - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Model'
          description: A list of models with with minimalized information.
        object:
          type: string
          description: The object type of `data` field, which is always `"list"`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer