Integrate agentkit

From worldcoin/agentkit · View interactive version

Integrate agentkit is an AI agent skill from the GitHub repository worldcoin/agentkit. Use this skill when integrating @worldcoin/agentkit into an x402 server or facilitator flow: choose free/free-trial/discount mode, wire payments on any supported EVM chain, handle ExactEvmScheme money parsing, or finish an integration end-to-end.

How to use this skill

Skill file

Integrate AgentKit

Use this skill for end-to-end server-side integration work with @worldcoin/agentkit.

Start by clarifying the integration

If the developer has not already answered these, ask before choosing an implementation:

  1. Which access mode do they want: free, free-trial, or discount?
  2. Which payment network should the protected route use?
  3. Do they control the facilitator path, or are they using a hosted facilitator?
  4. Do they also need agent registration, or only request-time verification?

Default recommendation

For most production integrations:

Key pieces

Workflow

  1. Read CODE0 first. It should be the primary integration playbook.
  2. Confirm exported APIs in CODE0 and CODE1 before adding imports.
  3. Prefer the hooks-based path:
  1. If the payment network is World Chain (eip155:480), add a custom ExactEvmScheme().registerMoneyParser(...) for World Chain USDC. Do not assume the server scheme has a working default stablecoin for World Chain.
  2. Call createAgentBookVerifier() with no arguments in the common case. Pass rpcUrl or contractAddress only for custom World Chain endpoints or non-canonical deployments.
  3. If the mode is free-trial or discount, add persistent AgentKitStorage. InMemoryAgentKitStorage is only for demos.
  4. If the mode is discount, wire hooks.verifyFailureHook into the facilitator. Without it, discounted underpayments will fail verification.
  5. Verify the whole path end-to-end:

Ground rules

Constants to keep handy

Reference files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.