Call third-party APIs from your Worker with typed bindings
capa turns an OpenAPI spec into a Cloudflare service binding. Call it from your Worker, or let your agent call it through one MCP server. Every call returns the response and an evidence record.
const { result, evidence } =
await env.STRIPE.paymentIntents.create({
amount: 2500,
currency: "usd",
});
console.log(result.id, evidence.act.status, evidence.verdict);
pi_... 200 pass How it works
Section titled “How it works”- 1
The provider publishes a spec
POST /v1/payment_intents - 2
capa generates a typed method
paymentIntents.create(body) - 3
You deploy it to your account
cf deploy - 4
Your Worker or your agent calls it
env.STRIPE.paymentIntents.create(…)
When the provider changes the spec, a weekly job regenerates the binding and opens a pull request.
Every call returns evidence
Section titled “Every call returns evidence”The evidence record says what capa sent, what came back, and which checks passed. Log it, show it, or ignore it.
{ operationId: "PostPaymentIntents", act: { request: { method: "POST", url: "https://api.stripe.com/v1/payment_intents" }, status: 200, }, assert: [{ kind: "httpStatus", expected: "2xx", actual: 200, passed: true }], verdict: "pass",}Call it from a Worker or an agent
Section titled “Call it from a Worker or an agent”From your Worker
Bind the capability and call typed methods. The API key stays in the capability Worker.
src/index.tsconst { result, evidence } =
await env.STRIPE.paymentIntents.create({
amount: 2500,
currency: “usd”,
});TutorialFrom your agent
Connect Claude or Cursor to capa-gateway. The agent writes code that runs in a sandbox with no network access. The sandbox calls the capability through the gateway, which adds your key from your vault.
MCP tool: executeconst me = await capa.github.user.list();
return me.result.login;Use capa from an agentQuick start
Section titled “Quick start”Deploy a capability from the catalog, set its key, then bind it from your Worker.
cd capabilities/stripecf migrate && cf deploycf workers secrets update STRIPE_API_KEY --worker capa-stripe --type secret_textenv: { STRIPE: bindings.worker({ worker: "capa-stripe", exportName: "StripeCapability" }),}Using Wrangler? The tutorial shows both.
Catalog
Section titled “Catalog”- Capabilities
- 16
- Operations
- 6,325
- Namespaces
- 570
- github
Repos, issues, pull requests, Actions, releases, and org workflows.
- kubernetes
Core Kubernetes resources and cluster APIs exposed through one generated binding.
- gitlab
Projects, MRs, pipelines: across the entire GitLab API.
- jira
Issues, boards, sprints: JSRPC over Jira Cloud REST v3.
- stripe
Charges, customers, and subscriptions without hand-writing a Stripe wrapper.
- box
Files, folders, collaboration, and metadata from the Box Platform API.
- discord
Applications, guilds, channels, messages, and webhooks from Discord HTTP API v10.
- sentry
Organizations, projects, issues, events, releases, and alerts from Sentry.
- twilio
Accounts, phone numbers, calls, messages, recordings, and Twilio REST resources.
- slack
Channels, chat, users, files, admin endpoints, and Slack Web API workflows.
- zoom
Meetings, webinars, recordings, users, reports, and Zoom account operations.
- twitch
Twitch Helix channels, streams, clips, chat, moderation, and creator workflows.
- blooio
Send iMessage from anywhere: chats, messages, contacts, groups, FaceTime, and webhooks.
- twilio-messaging
Messaging Services, senders, compliance registrations, and delivery controls.
- twilio-verify
Verification services, factors, templates, rate limits, and fraud-safe flows.
- htmlcsstoimage
Render HTML/CSS or URLs to PNG, JPG, WebP, or PDF: images, templates, OG configs, and storage.
To add an API, run the codegen against its spec. Keep the result in your account, or open a pull request to add it here.
Next steps
Section titled “Next steps”- Tutorial
Deploy a capability and call it from a Worker.
- Use from an agent
One MCP server for every capability.
- How it works
Service bindings, evidence, and generated code.
- Runtime auth
Use one deployed Worker for many tenants.
- Reference
Secrets, entrypoints, and codegen flags.