agent.enabled is true in gateway configuration.
For interactive request/response schemas and the API playground, use the HTTP API pages generated from gateway-openapi.yaml.
Responsibilities
- Accept SDK, backend, and agent requests.
- Authenticate owner-mode requests.
- Quote and validate exact agent round pricing (
amount == price). - Return x402 envelopes when pay-per-request escrow is underfunded.
- Dispatch node rounds and collect aggregate signatures.
- Maintain a settlement outbox for served rounds.
- Self-host via YAML/env config (see Self-hosting below).
Base URLs
Endpoints
The TypeScript SDK gateway client and MCP server wrap these HTTP endpoints for application and AI clients.
Agent endpoints require
agent.enabled: true and a configured gateway keypair (settlement.gateway_keypair_path).
Feed ID derivation
Clients do not send an on-chain create transaction. The gateway and SDK derive the feed identity from the caller, config hash, and quorum:- Subscription path:
ownerisconsumerAuthority. - Agent path:
owneris the payer. signatures_requiredis appended as a single byte.
feedId and echoes it in successful responses. The Solana Feed account is created lazily on first successful submit_data_update. Settlement creates a round receipt; it does not write the feed.
Subscription authentication
ForPOST /v1/round/execute, consumerAuthority signs:
feed_id is derived from (consumerAuthority, apiConfig, signaturesRequired). timestamp must be within the gateway clock skew window (default 300s). registryVersion must equal the current on-chain registry version. The signature is single-use per (feed_id, timestamp) — retries need a fresh timestamp and signature. An all-zero authSig is rejected.
x402 agent authentication
ForPOST /v1/agent/execute, the payer locks an exact USDC amount equal to the computed round price and signs AgentRequestAuth. Settlement via settle_agent_round is asynchronous.
Round price (USDC atomic units):
AgentRequestAuth hash:
agent_request_auth_sig may be omitted on the unfunded first request of the 402 discovery flow. After funding the escrow ATA, retry with the same canonical_timestamp and the signature. See x402 escrow for the full payment loop.
Data response
Successful round responses return the same signed payload shape from both execute paths. Live rounds always setfresh: true. Schema: DataUpdateResponse in the OpenAPI spec.
Serve lifecycle
- Validate JSON, pubkeys, timestamps, and API config.
- Derive
api_config_hashandfeed_id. - Verify request auth or x402 funding +
AgentRequestAuth. - Read advisory on-chain state.
- Reserve the round in the settlement outbox.
- Dispatch to nodes.
- Validate returned aggregate signature identity.
- Complete the outbox record (
pending). - Return the signed payload.
pending rows into settle_round_receipt or settle_agent_round when settlement.enabled is true.
Round-record PDAs
Replay protection is the unique round-record PDAinit:
Self-hosting
The gateway is a Go service configured by YAML and environment variables.agent.enabled is true, settlement.gateway_keypair_path is required because AgentRequestAuth binds the gateway PDA. If settlement is disabled, served rounds can remain pending indefinitely.
Settlement uses the on-chain protocol_config.usdc_mint; solana.usdc_mint only overrides serve-time ATA derivation and must match on-chain.
Why gateways are first-class in Brebeneskul
Brebeneskul adds economic routing around each request. The gateway is no longer only a convenience wrapper around nodes; it is also the coordination point for access models, payment checks, x402 envelopes, and settlement batching.Operational notes
- Use durable storage for the settlement outbox.
- Monitor pending outbox records and round timeout rates.
- Keep Solana RPC latency low for escrow and subscription reads.
- Verify returned payloads before application use.
Related pages
HTTP API
OpenAPI reference with schemas and interactive playground.
x402 escrow
Pay-per-request agent access and settlement.