Developer integration

Connect an agent to a bounded model purchase.

Use ToolkitFun's machine-readable manifest, Discovery API, MCP server, or open AgentPay SDK. Keep signing keys in a trusted wallet or credential store; the agent receives scoped progress credentials instead.

REST

Discover offers and check the payment rail before creating a reservation.

GET https://toolkit.fun/api/agentpay/v1/discovery GET https://toolkit.fun/api/agentpay/v1/readiness?provider=openrouter POST https://toolkit.fun/api/agentpay/v1/policies/{policyId}/reservations POST https://toolkit.fun/api/agentpay/v1/models/{provider}/{model}/invoke

MCP

Expose discovery, quote, reserve, invoke, reconcile, result, and public proof tools to an MCP client.

{ "mcpServers": { "toolkit-agentpay": { "url": "https://toolkit.fun/api/agentpay/mcp" } } }

Funding modes

ModeUse it whenSettlement
toolkit_creditsThe account or team owns ToolkitFun Cloud model allowance. Use the authenticated /api/agentpay/v1/credit-purchases route.ToolkitFun usage ledger and private receipt; idempotent by purchase ID.
x402_monadThe agent has a trusted wallet and a bounded testnet policy.x402 v2 upto, Permit2, Monad Testnet receipt.
byok_providerThe customer wants the provider relationship and key to stay theirs.Preview only. The public AgentPay route accepts no raw key; use the existing ToolkitFun BYOK workflow path.

Agent subscriptions

Agents can discover plans and request a subscription. A human configures the policy in Settings → Agent subscription; the server checks the plan, currency, provider and per-cycle limit before creating an order.

Discovery and request

GET /api/agentpay/v1/subscriptions/plans POST /api/agentpay/v1/subscriptions/preview POST /api/agentpay/v1/subscriptions/requests GET /api/agentpay/v1/subscriptions/requests/{requestId} GET /api/agentpay/v1/subscriptions/current

Use a stable 8–100 character requestId. Repeating it returns the original request and will not create a second order.

MCP tools

agent_subscription_plans agent_subscription_preview agent_subscription_request agent_subscription_status agent_subscription_current agent_subscription_cancel

Subscription mutations require a ToolkitFun API token with both run and billing scopes. The first purchase and checkout confirmation remain human-visible.

Automatic renewal. Only Stripe supports recurring Agent subscription checkout. Set autoRenew: false for a one-time subscription payment. Never retry with a new request ID after an unknown result; query the same request ID.

Recovery rules

Never retry an unknown payment by creating a new purchase. Keep the same purchase ID, call reconciliation, and wait for chain or provider evidence. Missing result access returns a purchase-scoped SIWX challenge. Recorded Demo mode never sends a payment.

Machine contracts

Public proof

GET /api/agentpay/v1/proofs/{publicProofId} returns redacted usage, settlement and receipt evidence without exposing prompts or model output.