# AI Foundry Compute **Mainnet compute is disabled pending safety review.** Production rejects compute purchases, refreshes, execution, and compute discovery with HTTP 503. Existing account statements remain readable. Only deployments explicitly configured with `NETWORK=base-sepolia` permit compute; changing the request body or headers cannot bypass this gate. Use the staging/testnet deployment for the examples below, not the production URL. > Persistent Linux workspaces for agents, prepaid with USDC over x402. Base URL: https://api.aifoundry.sh ## Quick start 1. POST /v1/session with {"credit_usd":0.1,"tier":"container"}. 2. Decode the HTTP 402 JSON body or base64 PAYMENT-REQUIRED header. Use an x402 client to sign the advertised payment and retry with PAYMENT-SIGNATURE. 3. Use the returned token as Authorization: Bearer . 4. POST /v1/compute/run with {"source":"echo hello","timeout_ms":20000}. The only available tier is container, and the default backend is container-shell. Node 22, Python 3, git, and build tools are installed. Files under /workspace persist between calls and container restarts. /tmp is disposable. ## Payment and billing - USDC on Base mainnet (eip155:8453); x402 v2. - Credit packs: $0.10, $1, $5, $20. Omitted credit_usd defaults to $5. - Compute: $0.000050176/second, rounded up to whole seconds and micro-USD. - One minute of credit is required to begin; no ten-minute minimum charge. - Each call is bounded by prepaid credit and a one-hour timeout. - One job per wallet at a time; concurrent calls return HTTP 409. - Tokens last 65 minutes. POST /v1/session/refresh renews a signed token (including an expired one) while prepaid credit remains. - GET /v1/account returns the balance and recent itemised ledger entries. - Containers start on demand and sleep after 45 seconds of inactivity. - Model generation and automatic storage billing are not enabled in this API. ## Endpoints GET /health — liveness and configuration status GET /v1/c4 — available VM size and compute rate GET /v1/pricing — rate reference GET /v1/capabilities — execution and network policy GET /v1/facilitators — available settlement facilitators GET /.well-known/x402 — discovery manifest POST /v1/session — buy credit POST /v1/session/refresh — renew bearer token POST /v1/compute/run — execute shell source GET /v1/account — balance and statement GET /v1/weather?location=Detroit — separate $0.01 x402 weather request ## Network and isolation A workspace is scoped to the verified paying wallet. Outbound HTTP(S) uses an allowlist; private, loopback, and metadata addresses are blocked. See /v1/capabilities for allowed hosts. Guard helpers in the codebase are not a screen for arbitrary terminal commands or third-party API responses. Built on Cloudflare Computer preview software. No proactive warm pool or retention/garbage-collection service is currently configured.