{"openapi":"3.1.0","info":{"title":"SiloRail gateway","version":"0.1.0","description":"OpenAI-compatible LLM gateway billing per call in USDC on Monad via x402. Unpaid requests to paid endpoints return HTTP 402 with a payment challenge; clients sign the challenge and retry with the PAYMENT-SIGNATURE header. See /llms.txt for a prose guide."},"servers":[{"url":"https://testnet.silorail.com"}],"paths":{"/health":{"get":{"summary":"Liveness","responses":{"200":{"description":"Process is up"}}}},"/status":{"get":{"summary":"Public beta status","responses":{"200":{"description":"Public service status"}}}},"/ready":{"get":{"summary":"Readiness, including facilitator gas runway and settlement counts","responses":{"200":{"description":"Safe to serve metered traffic"},"503":{"description":"Facilitator unreachable or low on gas"}}}},"/v1/pricing":{"get":{"summary":"Terms for deriving a quote locally (rates, margin, gas, schemes)","responses":{"200":{"description":"Pricing terms"}}}},"/v1/models":{"get":{"summary":"OpenAI-shaped list of free testnet models","responses":{"200":{"description":"Model list"}}}},"/v1/chat/completions":{"post":{"summary":"OpenAI-compatible chat completion behind an x402 paywall","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"type":"string"},"description":"Base64 x402 v2 payment payload. Omit to receive the 402 challenge."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"max_tokens":{"type":"integer","description":"Defaults to 1024; the quote is derived from it"},"stream":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Completion (JSON or text/event-stream). Headers: X-SiloRail-Request-Id, X-SiloRail-Quoted, X-SiloRail-True-Cost (non-streaming only)."},"400":{"description":"model_not_priced | testnet_free_models_only | unpriceable_content | malformed"},"402":{"description":"Payment required. Body and PAYMENT-REQUIRED header carry the x402 challenge with accepts[] listing upto and exact requirements."},"412":{"description":"Insufficient Permit2 allowance (upto); retryable"},"429":{"description":"exposure_cap; too much unsettled value for this payer"},"502":{"description":"Upstream failure; nobody is charged"}}}},"/v1/permit":{"post":{"summary":"Sponsor a payer's one-time Permit2 approval (the exact to upto upgrade)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["owner","spender","value","deadline","signature"],"properties":{"owner":{"type":"string"},"spender":{"type":"string","description":"Must be the canonical Permit2"},"value":{"type":"string"},"deadline":{"type":"string"},"signature":{"type":"string"}}}}}},"responses":{"200":{"description":"Broadcast (or already approved)"},"403":{"description":"unproven_payer; settle one call first"},"501":{"description":"Sponsorship not configured"}}}},"/v1/settlements/{requestId}":{"get":{"summary":"Public settlement receipt for a request","parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Receipt","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"model":{"type":"string"},"payer":{"type":"string"},"quoted_micro":{"type":"string","description":"Amount in micro-USD (1e-6 USD), as a string"},"true_micro":{"type":"string","description":"Amount in micro-USD (1e-6 USD), as a string"},"authorized_micro":{"type":"string","description":"Amount in micro-USD (1e-6 USD), as a string"},"settled_micro":{"type":"string","description":"Amount in micro-USD (1e-6 USD), as a string"},"scheme":{"type":"string","enum":["upto","exact"]},"state":{"type":"string","enum":["billing","pending","settled","failed"]},"tx_hash":{"type":["string","null"]},"raw_usage":{"type":"object","description":"Upstream usage block, unmodified"}}}}}},"404":{"description":"Unknown request id"}}}},"/faucet":{"post":{"summary":"Request testnet USDC (one tUSDC per address every two hours)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"Non-zero EVM address to receive tUSDC"}}}}}},"responses":{"200":{"description":"Transfer submitted; returns txHash and explorer link"},"400":{"description":"Malformed or zero address"},"409":{"description":"Address is already claiming"},"429":{"description":"Cooldown active; Retry-After header is set"},"502":{"description":"Transfer failed; no cooldown is consumed"}}}},"/llms.txt":{"get":{"summary":"Prose guide to this service for language-model agents","responses":{"200":{"description":"text/plain"}}}}}}