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 safe mental model
Current Public Scope
Hilt Pay API currently supports:solana_usdcas the live settlement rail- x402 as the HTTP
402 Payment Requiredprotected-resource protocol - API pricing through Sandbox, Starter, Growth, Scale, and Enterprise
- public SDKs on npm and PyPI
- public GitHub developer assets, OpenAPI, and Postman
1. Create a setup intent
setup_intent_id- one-time
setup_token - sandbox API key
- owner approval URL
- expiry
- allowed sandbox actions
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.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
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
5. Configure rail settings
The agent can configure the proposed live rail through the API once it has owner-approved credentials:6. Create app and product
Idempotency-Key on every write.
7. Check readiness and available rails
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:- Agent or user requests a protected resource with a stable request id.
- Your server calls
POST /v1/access/entitlements/consumefor one unit. - If consumption succeeds, serve the resource.
- If usage is missing, create a payment session with
POST /v1/access/payment-sessions. - Return HTTP
402 Payment Requiredwith Hilt’s x402 V2PAYMENT-REQUIREDheader. Solana USDC is the settlement rail. - The agent or buyer pays the advertised terms and retries your resource with
PAYMENT-SIGNATURE. - Your server sends that signature to
POST /v1/access/x402/settle. - Hilt verifies settlement, creates receipt and entitlement state, and returns
PAYMENT-RESPONSE. - Your server atomically consumes one unit with the same logical request id.
- 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: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
- 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

