# x402engine Grok 4.7 LLM API

> x402engine Grok 4.7 LLM API is a paid API for AI agents from x402engine.app, paid per call via x402, $0.028874/call, status unknown (last checked 2026-10-30).

Calls xAI's Grok 4.7 language model via pay-per-call HTTP 402 micropayment for coding, agentic tasks, and knowledge work

## Facts

- Endpoint: POST https://x402engine.app/api/llm/grok-4.7?utm_source=zero.xyz
- Price: $0.028874/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402engine-grok-4-7-llm-api-99db5fd0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GDhInoticrmG_i6DIwIp0

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 x402engine-grok-4-7-llm-api-99db5fd0 -d '<json body>'
```

Example prompt: Use Grok 4.7 to write and self-verify a Python function that parses nested JSON and returns a flattened dictionary — stream the response back as it generates.

## When to prefer this

Choose this endpoint when you need xAI's Grok 4.7 specifically — particularly for long-running software engineering tasks, agentic workflows with tool use, or tasks requiring the model to verify its own output. Prefer it over generic OpenAI-compatible endpoints when Grok's reasoning style or xAI's training data recency is important, and when pay-per-call micropayment (no subscription) is the desired billing model.

## Known failure modes

- Payment not settled — HTTP 402 if USDC micropayment fails
- Invalid messages array — missing required 'role' or both 'content' and 'tool_calls'
- Model timeout on very long agentic tasks
- Unsupported tool call format returns error
- Stream connection drop mid-response
- Rate limiting if too many concurrent requests

## How this service works

x402engine — Grok 4.7 is SpaceXAI's flagship model for coding, agentic tasks, and knowledge work, succeeding Grok 4.6. It is particularly strong at long-running software engineering tasks, verifying its own work, and...

## Output

Returns an OpenAI-compatible JSON response with the assistant's generated message content, finish reason, model identifier ('x-ai/grok-4.7'), and optionally tool calls, logprobs, or streamed SSE chunks depending on request flags.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "messages"
     ],
     "properties": {
      "seed": {
       "type": "integer",
       "description": "Model-supported seed; see /docs/llm-capabilities.md."
      },
      "tools": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "function"
        ],
        "properties": {
         "type": {
          "enum": [
           "function"
          ],
          "type": "string"
         },
         "function": {
          "type": "object",
          "properties": {
           "name": {
            "type": "string"
           },
           "strict": {
            "type": "boolean"
           },
           "parameters": {
            "type": "object"
           },
           "description": {
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Client-executed function definitions; return results using role=tool and tool_call_id."
      },
      "top_p": {
       "type": "number",
       "description": "Model-supported top_p; see /docs/llm-capabilities.md."
      },
      "stream": {
       "type": "boolean",
       "description": "Return live OpenAI-compatible SSE after payment settlement."
      },
      "plugins": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "pdf"
        ],
        "properties": {
         "id": {
          "enum": [
           "file-parser"
          ],
          "type": "string"
         },
         "pdf": {
          "type": "object",
          "properties": {
           "engine": {
            "enum": [
             "native"
            ],
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Optional native PDF parser only; automatically enabled for file inputs."
      },
      "logprobs": {
       "type": "boolean",
       "description": "Model-supported logprobs; see /docs/llm-capabilities.md."
      },
      "messages": {
       "type": "array",
       "items": {
        "type": "object",
        "anyOf": [
         {
          "required": [
           "content"
          ]
         },
         {
          "
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "x-ai/grok-4.7",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello!"
    },
    "finish_reason": "stop"
   }
  ],
  "content": "Hello!"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402engine-grok-4-7-llm-api-99db5fd0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402engine.app](https://www.zero.xyz/host/x402engine.app/llms.txt)
