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:
- Which access mode do they want:
free,free-trial, ordiscount? - Which payment network should the protected route use?
- Do they control the facilitator path, or are they using a hosted facilitator?
- Do they also need agent registration, or only request-time verification?
Default recommendation
For most production integrations:
- Put paid routes on whichever network the developer's facilitator already supports (commonly World Chain
eip155:480or Baseeip155:8453). - Leave AgentBook lookup alone —
createAgentBookVerifier()always resolves against the canonical World Chain deployment. The developer does not need to think about which chain the registry lives on. - Start with
free-trialunless the developer explicitly wantsfreeordiscount. - Only choose
discountwhen you can wirehooks.verifyFailureHookinto the facilitator flow you control.
Key pieces
- x402 resource server: the protected HTTP route and 402 challenge flow
- facilitator: verifies and settles payment payloads; required for
discount - AgentKit extension: adds the CAIP-122 challenge and verifies the signed
agentkitheader - AgentBook: on-chain registry on World Chain that maps the agent wallet to an anonymous human ID. Lookup is always against World Chain regardless of the payment chain — the caller side is chain-agnostic.
- storage: per-human usage tracking for
free-trialanddiscount - registration path: separate from request-time verification; use
npx @worldcoin/agentkit-cli --llmsif the developer also needs registration help