Agent setup

Agent setup is the Hilt Pay API path for software that wants to configure paid access without asking the merchant to click through every technical step. Use it when an AI agent, Cursor workflow, platform agent, developer tool, or integration bot needs to:
  • create a sandbox setup intent
  • propose the app, product, protected resource, webhook, and settlement rail
  • test the denied -> 402 -> payment -> proof -> entitlement loop in sandbox
  • hand live approval back to the owner
  • receive scoped live credentials only after owner approval
The goal is agent-first without being reckless. Agents can prepare the integration. Owners still control live billing, live API keys, payout wallets, production rail settings, and emergency disable. For agentic payments, setup is only half the job. At runtime, a metered protected resource must atomically consume one unit and serve only after settlement and consumption succeed. Use entitlement checks for durable access display and planning.

The safe mental model

Current Public Scope

Hilt Pay API currently supports:
  • solana_usdc as the live settlement rail
  • x402 as the HTTP 402 Payment Required protected-resource protocol
  • API pricing through Sandbox, Starter, Growth, Scale, and Enterprise
  • public SDKs on npm and PyPI
  • public GitHub developer assets, OpenAPI, and Postman
x402 is the protocol shape an agent sees when a protected resource requires payment. Hilt returns that requirement with the current settlement details needed to complete payment. Agentic payments describe this paid-resource loop. They are not a separate chain, token, wallet, or rail. Base USDC, selected EVM USDC chains, and USDT are not currently public settlement options unless the public docs and changelog explicitly say they are live.

1. Create a setup intent

The response includes:
  • setup_intent_id
  • one-time setup_token
  • sandbox API key
  • owner approval URL
  • expiry
  • allowed sandbox actions
The sandbox key is not a live-money key.

2. Submit a setup manifest

The manifest is the agent’s proposed plan. It should be explicit enough for the owner and Hilt to understand what will be created.
Hilt returns normalized setup state, readiness blockers, warnings, the next API actions, and a Hilt Pay API tier recommendation. The agent must make the billing decision explicit. Use billing_model: "one_off" for a single payment that grants a fixed access period. Use billing_model: "recurring" when access renews. Hilt Pay API recurring products use renewal_mode: "solana_native_subscription". Hilt keeps cancellation period-aware by default: if the buyer cancels, future collection stops and access remains until the paid-through date. The recommendation uses expected_monthly_volume_minor_units, expected_monthly_volume_usd, expected_monthly_payments, expected_monthly_webhook_events, and expected_monthly_entitlement_checks when the agent supplies them. It compares Starter, Growth, and Scale using the API subscription price plus Solana USDC transaction fees. If the agent does not know volume yet, Hilt defaults the recommendation to Starter and asks for better assumptions instead of forcing the owner to guess.

3. Poll setup status

Use this while waiting for owner approval.

4. Owner approval

The owner opens the approval URL from a first-party Hilt session. The approval page is the trust handoff between the agent and the account owner. It shows the agent, requested permissions, product, price, protected resource, protocol, settlement rail, blockers, warnings, and the recommended API plan. The owner should only need to approve the intent, subscribe to the right API tier if needed, and confirm payout rail settings. They should not have to recreate the setup the agent already prepared. Approval can issue scoped live access for the owner’s workspace, but it does not bypass:
  • API billing plan checks
  • payout wallet setup
  • rail health and live availability
  • live-mode confirmation
  • webhook signing secret handling
  • emergency disable controls
Agents should treat owner approval as the transition from sandbox setup to live-capable setup. They should not pretend sandbox credentials are production credentials.

5. Configure rail settings

The agent can configure the proposed live rail through the API once it has owner-approved credentials:
Rail settings belong to the merchant account. Keep sensitive provider and signing credentials server-side in a secure secrets manager; never paste them into browser code, shared examples, or public documentation.

6. Create app and product

Agents should use Idempotency-Key on every write.

7. Check readiness and available rails

Render only payment_session_options.session_creatable_rails[] to a buyer or agent. allowed_rails[] is policy; it is not proof that a rail is ready to appear in checkout.

8. Runtime protected-resource loop

The application should behave like this:
  1. Agent or user requests a protected resource with a stable request id.
  2. Your server calls POST /v1/access/entitlements/consume for one unit.
  3. If consumption succeeds, serve the resource.
  4. If usage is missing, create a payment session with POST /v1/access/payment-sessions.
  5. Return HTTP 402 Payment Required with Hilt’s x402 V2 PAYMENT-REQUIRED header. Solana USDC is the settlement rail.
  6. The agent or buyer pays the advertised terms and retries your resource with PAYMENT-SIGNATURE.
  7. Your server sends that signature to POST /v1/access/x402/settle.
  8. Hilt verifies settlement, creates receipt and entitlement state, and returns PAYMENT-RESPONSE.
  9. Your server atomically consumes one unit with the same logical request id.
  10. Serve only after settlement and consumption succeed.

9. Billing checkout for Hilt Pay API

Account owners can create a Stripe Checkout session for Hilt Pay API billing:
API keys and sandbox setup-intent keys cannot change account billing.

Agent rules

Agents should:
  • keep Hilt keys server-side only
  • use sandbox setup first
  • include idempotency keys
  • use atomic consumption as the authority for each metered request
  • use entitlement checks for durable or time-based access display and planning
  • treat x402 as protocol and Solana USDC as the current public live settlement rail
  • use webhooks for post-payment automation
  • keep Hilt ids and external ids in the app database
  • show owner approval and billing steps clearly
Agents must not:
  • embed Hilt keys in browser code
  • treat sandbox credentials as live credentials
  • show blocked rails as buyer options
  • claim Base/EVM/USDT are live unless the public docs say so
  • grant access from a pending payment session
  • treat webhook delivery alone as enough to serve protected work without an entitlement check

Go deeper