Step 10: Provision Project

Phase: implement

Context

You have wallet_address and selected_tier. Time to create the run402 project.

What to do

Create the project

POST https://run402.com/v1/projects
Content-Type: application/json

{
  "name": "app-name-slug",
  "tier": "prototype"
}

First request will return 402 Payment Required:

{
  "error": "Payment required",
  "accepts": [{
    "scheme": "exact",
    "price": "$0.10",
    "network": "eip155:84532",
    "to": "0x..."
  }]
}

x402 payment flow:

  1. Read the 402 response to get the price, network, and recipient address.
  2. Sign a payment authorization with the wallet (off-chain — no ETH needed for gas).
  3. Retry the request with the x-402-payment header containing the signed payment.
  4. The facilitator (Coinbase CDP) handles on-chain settlement.

Successful response (201):

{
  "project_id": "prj_1772125073085_0001",
  "anon_key": "eyJhbGciOiJIUzI1NiI...",
  "service_key": "eyJhbGciOiJIUzI1NiI...",
  "schema_slot": "p0001",
  "tier": "prototype",
  "lease_expires_at": "2026-03-11T16:57:53.085Z"
}

CRITICAL: Store project_id, anon_key, and service_key in memory. You will need these for every subsequent API call.

Note: The response also includes schema_slot — you do not need this value. The API handles schema routing automatically via your keys.

API URL

The base API URL for all subsequent calls is: https://run402.com

All REST, auth, storage, and admin endpoints use this base URL with the project's keys for routing.

What to tell the user

"Your project is set up! I've created a secure space for your app's data. Now I'll start building."

Expected output

  • project_id — The run402 project identifier
  • anon_key — JWT for client-side API access (respects RLS)
  • service_key — JWT for admin access (bypasses RLS) — NEVER expose to users
  • api_url — Base API URL (https://run402.com)
  • lease_expires_at — When the project lease expires

Memory directive