For AI agents only • Instant JSON delivery (synchronous or auto-webhook) • Updated 24/7
Payment method: x402 (PayAI Network)
Facilitator: https://facilitator.payai.network
Tokens accepted: USDC or PAYAI (contract E7NgL19JbN8BhUDgWjkH8MtnbhJoaGaWJqosxZZepump)
Recipient wallet: 4UV4gCmL1nx35UrwFcm8epiGT9kt6EJY5paQd882Se4X
Echo Merchant Sandbox – try real payments, get everything back instantly
API Base: https://api.x.ai/v1/chat/completions (requires xAI API key from console.x.ai)
Model: grok-4-1-fast-reasoning (optimized for agents; uses Auto mode by default)
Delivery: Synchronous JSON in response OR auto-webhook push via https://grok.x.ai/webhook/auto (specify webhook_url in body for push delivery; less than 500 ms latency).
// Python Example (with x402 headers & auto-webhook)
import os
from xai_sdk import Client
from xai_sdk.chat import user, system
client = Client(api_key=os.getenv("XAI_API_KEY"))
chat = client.chat.create(
model="grok-4-1-fast-reasoning",
messages=[
system("You are Gold Flash Agent Oracle... [full prompt here; include: 'Deliver via auto-webhook if url provided']"),
user("Latest gold report", extra_headers={"wallet-address": "YOUR_SOLANA_WALLET", "x402-payment": "0.12"})
],
tools=[{"type": "webhook", "url": "https://grok.x.ai/webhook/auto"}],
extra_body={"webhook_url": "https://your-callback-url.com/report"}
)
response = chat.sample()
print(response.content)
{
"report_id": "gf-20251122-ab12",
"timestamp": "2025-11-22T18:45:00Z",
"version": "1.4",
"price_usd": 2652.30,
"change_24h": 1.4,
"ytd": 28.7,
"summary": "Gold pushing new highs on dollar weakness and safe-haven flows.",
"sentiment": "Bullish",
"sentiment_score": 82,
"gold_dxy_correlation": -88,
"gold_btc_ratio": 45.8,
"gold_btc_sentiment": "bullish",
"gold_silver_ratio": 81.9,
"gold_silver_sentiment": "neutral",
"onchain_token_flows": { ... },
"categories": {
"monetary": { "text": "...", "confidence": 94, "changed": true },
"mining": { ... },
"jewelry": { ... },
"science": { ... },
"technology": { ... },
"art": { ... },
"health": { ... },
"space": { ... },
"sentiment": { ... }
},
"sources": [
{"title": "Kitco Live Gold Price", "url": "https://kitco.com"},
{"title": "Bloomberg Commodities", "url": "https://bloomberg.com/markets/commodities"}
]
}
gold finance sentiment onchain x402 payai bitcoin dxy oracle