# Grok via Locus x402 — Chat Completions

> Grok via Locus x402 — Chat Completions is a paid API for AI agents from grok.x402.paywithlocus.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Send chat messages to xAI's Grok models (grok-4.5, grok-4.3, reasoning/non-reasoning variants) and receive completions, with per-call USDC micropayment via x402 protocol.

## Facts

- Endpoint: POST https://grok.x402.paywithlocus.com/grok/chat
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/grok-via-locus-x402-chat-completions-0b50aa25
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rVTsBGByptaHQOwZK8-sx

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 grok-via-locus-x402-chat-completions-0b50aa25 -d '<json body>'
```

Example prompt: Use grok-4.5 to explain the trade-offs between transformer and state-space models in at most 300 tokens — keep the temperature at 0.7 and stop if you hit the phrase 'In conclusion'.

## When to prefer this

Choose this endpoint when you need to call xAI's Grok models (especially grok-4.5 or reasoning variants) with a pay-per-call USDC micropayment model via the x402 protocol, avoiding API key subscriptions. Ideal for agents that need metered, on-demand Grok inference without committing to a monthly plan, or for decentralized agent pipelines that settle payments on-chain.

## Known failure modes

- Insufficient USDC balance or failed x402 payment authorization — returns payment failure error
- Invalid or unsupported model ID provided — returns model not found or validation error
- max_tokens not specified — required for metered billing; returns validation error
- Token limit exceeded for the chosen model — returns context length error
- Malformed messages array (wrong role values or content structure) — returns 400 bad request
- Request timeout for long-running reasoning completions
- Rate limiting if too many concurrent requests are submitted

## How this service works

xAI models — chat, web/X search, code execution, image generation/editing, and text-to-speech.

## Output

A JSON object containing: a `data` field with the xAI chat completion payload (choices, message content, usage), a `payment` object showing the settled and authorized USDC amounts, a `request` object with a unique UUID and a status polling URL, and a boolean `success` flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "n": {
   "type": "number"
  },
  "stop": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "string"
     }
    }
   ]
  },
  "model": {
   "type": "string"
  },
  "top_p": {
   "type": "number"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "role": {
      "type": "string"
     },
     "content": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "type"
         ],
         "properties": {
          "text": {
           "type": "string"
          },
          "type": {
           "type": "string"
          },
          "image_url": {
           "type": "object",
           "required": [
            "url"
           ],
           "properties": {
            "url": {
             "type": "string"
            }
           },
           "additionalProperties": true
          }
         },
         "additionalProperties": true
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "tool_calls": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      }
     },
     "tool_call_id": {
      "type": "string"
     }
    },
    "additionalProperties": true
   }
  },
  "max_tokens": {
   "type": "number"
  },
  "temperature": {
   "type": "number"
  },
  "presence_penalty": {
   "type": "number"
  },
  "frequency_penalty": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "payment": {
   "scheme": "exact",
   "settledUsdc": "0.001000",
   "authorizedMaxUsdc": "0.001000"
  },
  "request": {
   "id": "00000000-0000-4000-8000-000000000000",
   "statusUrl": "/requests/00000000-0000-4000-8000-000000000000"
  },
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/grok-via-locus-x402-chat-completions-0b50aa25/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from grok.x402.paywithlocus.com](https://www.zero.xyz/host/grok.x402.paywithlocus.com/llms.txt)
