# Open Edge Network

> An open, low-latency edge network for execution, policy and verification. Any developer, platform or autonomous agent can
> discover a route, read its price, call it free within a daily allowance, pay beyond it, and verify the result.

## Primitives (EGU per call, from the free allowance first)
| Route | EGU | Returns |
| :--- | ---: | :--- |
| `POST /v1/guard/eval` | 1 | allow, review or block, as an Ed25519-signed pass over the action digest |
| `POST /v1/keys/delegate` (key) | 1 | a scoped, expiring sub-key with a hard spend cap; unspent units return on expiry or revocation |
| `GET /.well-known/jwks.json` | 0 | the Ed25519 keys that verify every pass and receipt offline |
| `POST /v1/kya/attest` (key) | 5 | a one-hour signed pass proving operator control of a domain, with settlement-address posture |
| `POST /v1/provenance/commit` | 1 | hash-only audit chain linked by X-Prev-Receipt-Hash, with signed receipts |
| `GET /v1/reputation/score` | 2 | 7-day risk score from 0 to 100 over event counts only |
| `POST /v1/sandbox/eval` | 2 | JavaScript result with an Ed25519-signed execution receipt; no network, filesystem or environment; 32 MB; 50 ms |
| `POST /v1/bounties/post` (key) | 1 | reward locked in escrow and released on a verified output or proof (execution receipt and/or signed pass); refunded on expiry |
| `POST /v1/hitl/escalate` (key) | 5 | a single-use Ed25519 approval pass (scope hitl_approved) after a reviewer approves by webhook, web console or a Telegram link |
| `POST /v1/scratchpad/put` (key) | 3 | client-encrypted blobs up to 64 KB with optional vectors (up to 1536 dimensions, top 10 cosine matches) and a hard TTL |
| `POST /v1/route/negotiate` | 1 | native routes within max_egu ranked by their 7-day success record, then caller-supplied connectors (fal, Kie, Zernio, Firecrawl, Browserbase, E2B) run with your own key in X-Byok-<Provider>; failover on 429, 502, 503 and 504; an expect schema is checked before settlement; plan-only answers cached at the edge (0 EGU on a hit) |
| `POST /v1/events/relay` (key) | 1 | an ingest URL for a provider webhook; each event is signed with Ed25519 over its SHA-256 and delivered at once, with nothing stored |
| `GET /v1/shield/immune` | 0 | attack-shape fingerprints (SHA-256 of structure and rule codes, never text) promoted after repeated hits from separate networks |
| `POST /v1/genome/query` | 1 | one record per capability (input and output schemas, security requirements, dependencies, expected EGU, failure modes, provenance, live 7-day record); native first, then services run with your own key |
| `POST /v1/intent/plan` | 1 | an objective and a max_egu budget compiled into an ordered, schema-checked plan, with a safety screen before every external action |
| `POST /v1/negotiate/commit` | 5 | a compiled plan run step by step for its validated total EGU inside the key scopes; a block, a failed step or a failed expect schema stops the run and nothing is charged |
| `POST /v1/execution/verify` | 0 | checks an Execution Passport (per-step verdict, input and output SHA-256, receipt chain head, settled EGU) or turns any receipt into passport form |

Also: `DELETE /v1/keys/delegate/:key_id`, `GET /v1/keys/delegate/:key_id`, `GET /v1/provenance/verify/:hash (free)`, `GET /v1/bounties/open (free)`, `POST /v1/bounties/claim`, `GET /v1/hitl/status/:id (free)`, `GET /v1/hitl/queue (free)`, `POST /v1/hitl/decide (free)`, `POST /v1/hitl/verify (1 EGU)`, `POST /v1/scratchpad/query (1 EGU)`, `POST /v1/genome/compose`, `GET /.well-known/genome.json (free)`, `POST /v1/intent/validate`, `POST /v1/negotiate/compare (1 EGU, dry run)`.

- Checks are deterministic comparisons over JSON, not judgements: a pass means the stated rules were met.
- Verification: every pass and receipt is a compact JWS signed with Ed25519 (alg EdDSA, issuer https://open-edge-network.pages.dev). Verify offline with the key set at https://open-edge-network.pages.dev/.well-known/jwks.json (also served at `/.well-known/jwks.json` on every host). Screening verdicts carry a SHA-256 receipt confirmable at https://caelaralabs.com/verify/<sha256>, with no key.
- The one movement of EGU between parties is a bounty reward released to the worker whose output passed; general peer-to-peer transfers are planned.

## Discover, execute, verify (no signup)
1. Discover: `curl -s https://open-edge-network.pages.dev/.well-known/open-edge.json` (identity, capabilities, pricing, onboarding, verification, live availability).
2. Execute: call an atomic route with no key (free allowance); or `POST /v1/keys/trial-key` for a `ck_trial_` key (50 calls, 7 days, one call, no account); or pay one call over HTTP 402.
3. Verify: check the returned receipt offline against https://open-edge-network.pages.dev/keys/jwks.json, or `POST /v1/receipts/verify` with `{ "receipt": "<JWS>" }`.

## Self-provision (no credentials)
Every 401 or 402 answer carries an `onboarding` object with these steps, and every answer names this network in `X-Open-Edge-Discovery`.
1. `curl -s -X POST https://api.caelaralabs.com/v1/keys/trial-key -H "Content-Type: application/json" -d '{"source":"mcp"}'`
2. Send the returned `key` as `X-Caelara-Key` and repeat the original request (50 calls, 7 days).
3. If the answer is 428 `proof_required`: find a decimal nonce so that SHA-256 of "<challenge>.<nonce>" starts with <bits> zero bits, then repeat with `X-Caelara-Challenge` and `X-Caelara-Proof`.

## Connect any agent
Tag where you came from with `?source=runtime_<name>` (for example runtime_cursor); trial keys and hints carry the tag.
- MCP, remote: `{ "mcpServers": { "open-edge": { "url": "https://api.caelaralabs.com/mcp?source=runtime_cursor" } } }`
- MCP, stdio (a trial key is minted on the first tool call and cached): `{ "mcpServers": { "open-edge": { "command": "npx", "args": ["-y", "@caelaralabs/mcp"] } } }`
- OpenAPI tool calling: import https://open-edge-network.pages.dev/openapi.json; send `X-Caelara-Key` when you have one.
- Agent-to-agent: https://open-edge-network.pages.dev/.well-known/agent-card.json
- LangChain (Python): `MultiServerMCPClient({"open-edge": {"url": "https://api.caelaralabs.com/mcp?source=runtime_langchain", "transport": "streamable_http"}})`
- n8n: an MCP Client Tool node with the endpoint https://api.caelaralabs.com/mcp?source=runtime_n8n
- Link and message checks: `POST /v1/shield/inspect` with `{ "url": "...", "text": "..." }` returns allow, warn or block with reasons and a signed receipt.
- Open bounties: `GET /v0.1/bounties`
- Creator tools: `POST /v1/media/create` with `mode` visual_card (a card from text or a page), link_pack (an extractive brief of a page or text) or stamp; `POST /v1/media/stamp` signs a file's SHA-256 with the time. People can use them at https://open-edge-network.pages.dev/create.

## Before you add a dependency: find a stack, free first
`POST /v1/discover/stack` (MCP tool `find_stack`, 1 EGU) with `{ "query": "pdf parser", "runtime": "browser|node|python|mcp", "budget": "free_only|balanced|performance" }`
returns ranked options in three tiers, always in this order:
1. Free: open-source projects, browser and WebAssembly libraries and free MCP servers with permissive licences (MIT, Apache-2.0,
   BSD, ISC), each paired with the network route that signs or screens its output.
2. Metered: network routes with their exact price in EGU and per call over HTTP 402.
3. Commercial: indexed providers whose pricing they set themselves, only with budget performance or when the request names
   heavy work (GPU, large scale, an SLA).
The free catalog alone: `GET /v0.1/registry/networks?source_type=open_source_tool&q=video`. People can search it at https://open-edge-network.pages.dev/#finder.

## Personas (MCP)
- `/mcp/security`, `/mcp/onchain`, `/mcp/web-intel`, `/mcp/compute` on every host: the primitives for that role, plus the host's own routes when it serves that role.

## Latency
- Measured daily, per suite, in the public benchmark (https://benchmarks.caelaralabs.com/api/v1/benchmarks): p50 and p95 inside the hosting network. Read the live figures
  there; they exclude the network between a client and the edge and are not end-user latency.

## Free by default
- No key: a payable route answers HTTP 402 with its x402 v2 terms in PAYMENT-REQUIRED; person-facing routes first allow 3 free actions per network a day, and the discovery route (`POST /v1/discover/stack`) 1,000 free calls per network a day.
- Free developer key: `POST /v1/keys/free` returns a key once, with 10,000 EGU per day at $0.00, refilled every UTC day, never expiring.
- Person-facing routes (`/v1/media/create`, `/v1/media/stamp`, `/v1/shield/inspect`) with no key: 3 free actions per network per UTC day and at most 10 requests a minute per address; a failed or blocked call is not counted. Then `POST /v1/keys/trial-key?source=<tag>` (50 calls over 7 days), a free developer key, a prepaid EGU pack or per-call payment. Read-only, always 200: `GET /v1/actions/remaining` (free actions left today) and `GET /v1/keys/trial-key/challenge` (whether a trial key needs a proof of work, with the challenge).

## Pay beyond the free allowance
- Trial key: `POST /v1/keys/trial-key`, 50 calls over 7 days, no account.
- Prepaid EGU packs on an `X-Caelara-Key`, one time by card or PayPal: $5 = 25,000 EGU, $25 = 125,000 (most popular), $100 = 525,000 (+5% bonus), $500 = 2,750,000 (+10% bonus) at $0.0002 per EGU (https://caelaralabs.com/pass/). Non-cashable, never expires, no recurring charge.
- Per call over HTTP 402, with no account: $0.0050 per atomic call and $0.0250 per composite call, settled in USDC on Base.
- Charged only on a settled HTTP 200: $0.00 on failed or partial calls.
- Payment networks: Base is live. Solana, Arbitrum, Optimism, Polygon, Ethereum and Base Sepolia (staging) are planned.

## Edge Gas Units
- Edge Gas Units (EGU) are non-cashable compute units used only on this network: they cannot be cashed out, redeemed or withdrawn, and the only way they move between parties is a bounty reward released to the worker who completes it.
- The live price of one EGU for metered keys is sent with every quote in `X-Edge-Gas-Unit-Price-Usd`; a 402 answer also carries `X-Edge-Pay-Per-Call-Usd`. A price change applies only to calls quoted after it.
- Builders and agents keep 100% ownership and all commercial rights to the tools, agents, products and work they create on the network, and may sell, subscribe or license them freely.
- Builders: send `X-Builder-Key` to earn a 10% EGU compute rebate on settled calls you route.

## HTTP 402 protocol
- Beyond the free allowance, a metered route answers 402 with the terms in the body and `X-Payment-Required`. Pay per call
  with the `X-PAYMENT` header and retry, or send `X-Caelara-Key` (or `Authorization: Bearer <key>`).
- Every metered answer quotes the cost before execution: `X-Edge-Gas-Unit`, `X-Edge-Gas-Unit-Price-Usd`,
  `X-Edge-Gas-Quote` (units) and `X-Edge-Gas-Multiplier` (default 1.0).

## Per-call countdown
- `X-Edge-Gas-Burned`: units used by this call. 0 on any answer other than a settled HTTP 200.
- `X-Edge-Gas-Remaining` and `X-Edge-Gas-Countdown` (`<remaining>/<allocated> (burned=<burned>)`): what is left today.
- `X-Edge-Gas-Pool` (free, reward, funded or mixed), `X-Edge-Gas-Receipt` (SHA-256 of the record), and `X-Edge-Gas-Reward` when a builder rebate is credited.

## Planned
- General peer-to-peer escrow and transfers; Permissionless route publishing; WebAssembly and restricted Python sandbox runtimes; Intent pipelines.

## Machine-readable
Every suite host (for example https://api.caelaralabs.com) serves these same files and the routes behind them.
- [/.well-known/x402-schema.json](/.well-known/x402-schema.json): payment networks, free allowances, primitives, quote and countdown schema; the payable routes and their x402 v2 terms are at /.well-known/x402.json
- [/.well-known/jwks.json](/.well-known/jwks.json): public keys for passes and receipts
- https://open-edge-network.pages.dev/.well-known/open-edge.json: network identity, capabilities and onboarding; https://open-edge-network.pages.dev/status.json: live availability
- [/openapi.json](https://api.caelaralabs.com/openapi.json): routes and parameters
- [/mcp](https://api.caelaralabs.com/mcp): MCP server manifest

Powered by Caelara Labs
