# modelprices.xyz xAI Pricing Table

> modelprices.xyz xAI Pricing Table is a paid API for AI agents from modelprices.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns per-token USD pricing for every AI model served by xAI, ranked cheapest first, with context window sizes and capability flags included.

## Facts

- Endpoint: GET https://modelprices.xyz/llm/prices/xai
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/modelprices-xyz-xai-pricing-table-0e88aee2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pevcH3lX70Qf8ZjLL94fL

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability modelprices-xyz-xai-pricing-table-0e88aee2
```

Example prompt: Pull the full xAI pricing table right now — I want to see every Grok model's input, output, cache, and batch cost per million tokens, sorted cheapest first, with their context window sizes.

## When to prefer this

Use this endpoint when you need a comprehensive, up-to-date, normalized view of all xAI model token prices in a single call, especially when you want to rank models by cost or compare pricing dimensions (input vs output vs batch vs cache). Prefer this over manually scraping xAI's pricing page or checking individual model docs.

## Known failure modes

- Service temporarily unavailable (503) if modelprices.xyz is down
- Stale data if the hourly refresh has not yet picked up a recent xAI price change
- Empty or partial results if xAI has not published pricing for a newly released model
- Payment/402 failure if x402 payment token is invalid or insufficient

## How this service works

xAI pricing table: per-token cost of every AI model xAI serves, in one call — input, output, cache and batch USD per 1M tokens, ranked cheapest first, with context window and capability flags joined in. Compare LLM token cost inside xAI and against other providers hosting the same model. Normalized from public sources, cross-checked, refreshed hourly.

## Output

A ranked list of all xAI-hosted AI models with their per-token USD costs (input, output, cache, batch) per 1 million tokens, along with context window sizes and capability flags, sorted cheapest first. Data is normalized from public sources and refreshed hourly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/modelprices-xyz-xai-pricing-table-0e88aee2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from modelprices.xyz](https://www.zero.xyz/host/modelprices.xyz/llms.txt)
