{"title":"Coin Railz MCP Integration Guide","version":"1.0.0","audience":"Developers building MCP servers, LLM agent frameworks, or tool plugins that call Coin Railz services.","summary":"If you are building an MCP wrapper for Coin Railz and are stuck at the payment step: skip on-chain complexity entirely. Use Path A (API key credits) to get paid access in under 60 seconds.","paths":{"pathA":{"label":"Path A — API Key Credits (Fastest, no crypto required)","steps":[{"step":1,"action":"Get your free trial key","method":"GET","endpoint":"https://coinrailz.com/api/m2m/credits/trial","curl":"curl https://coinrailz.com/api/m2m/credits/trial","response":{"apiKey":"cr_live_...","credits":5,"expiresIn":"7 days"},"note":"SAVE the apiKey — returned once only. $5 credit, good for ~80–100 calls."},{"step":2,"action":"Call any service with your key","method":"POST","endpoint":"https://coinrailz.com/x402/{serviceId}","curl":"curl -X POST https://coinrailz.com/x402/gas-price-oracle -H 'X-API-KEY: cr_live_...' -H 'Content-Type: application/json' -d '{}'","billingHeaders":{"X-Credits-Used":"credits deducted for this call","X-Credits-Remaining":"your remaining balance","X-Recharge-Url":"link to buy more credits"}},{"step":3,"action":"Buy more credits when trial runs out","method":"POST","endpoint":"https://coinrailz.com/api/m2m/credits/checkout/session","curl":"curl -X POST https://coinrailz.com/api/m2m/credits/checkout/session -H 'Content-Type: application/json' -d '{\"amount\": 10}'","note":"Returns a Stripe hosted checkout URL. Complete in browser. API key is auto-provisioned within ~60s of payment."}]},"pathB":{"label":"Path B — Native x402 On-Chain USDC (for crypto-native agents)","description":"Standard x402 protocol (EIP-7615). Call endpoint → receive 402 challenge → construct payment header → retry with payment.","steps":[{"step":1,"action":"Call any x402 endpoint — receive 402 challenge","curl":"curl -X POST https://coinrailz.com/x402/gas-price-oracle -H 'Content-Type: application/json' -d '{}'","response402":{"status":402,"headers":{"WWW-Authenticate":"Payment ..."}}},{"step":2,"action":"Parse challenge, construct X-Payment header","note":"Use the x402 SDK: https://github.com/coinbase/x402 or Dexter at https://dexter.cash","sdks":{"typescript":"npm install x402","python":"pip install x402"}},{"step":3,"action":"Retry with payment header","curl":"curl -X POST https://coinrailz.com/x402/gas-price-oracle -H 'Content-Type: application/json' -H 'X-Payment: <base64-payload>' -d '{}'","facilitators":["cdp.coinbase.com","dexter.cash"]}]}},"serviceDiscovery":{"catalog":"https://coinrailz.com/x402/catalog","mcpServices":"https://coinrailz.com/mcp/services","openapi":"https://coinrailz.com/openapi.json"},"support":{"email":"support@coinrailz.com","humanGuide":"https://coinrailz.com/mcp-integration-guide"}}