Quick Start
agent.json is an open protocol — you can implement it on any stack that serves HTTP. This quick start uses the reference implementation, which runs on Cloudflare Workers. If you’d rather build your own, see the Protocol docs for the full spec.
Deploy the reference implementation
Section titled “Deploy the reference implementation”Prerequisites
Section titled “Prerequisites”- A Cloudflare account with a domain
- The domain’s email sending configured in Cloudflare Dashboard (Compute & AI > Email Service > Email Sending) — Cloudflare will add SPF and DKIM records automatically
Deploy
Section titled “Deploy”git clone https://github.com/charl-kruger/agent.json.gitcd agent.json/workers/agent-jsonpnpm installpnpm run deployConfigure
Section titled “Configure”- Open your deployed worker URL in a browser
- Go to the Configuration tab
- Set your domain (e.g.
agent-json.com) and default email (e.g.[email protected]) - Generate an auth token — agents use this to authenticate
- Add actions — define callable actions with parameter schemas and optional response schemas
Example actions:
| Action | Description | |
|---|---|---|
request_refund | [email protected] | Request a refund for an order |
get_support | [email protected] | Technical support and help |
partnership | [email protected] | Business partnership inquiries |
bug_report | [email protected] | Bug reports and issues |
Messages that don’t match any action route to your default email.
Test it
Section titled “Test it”Send a structured message:
curl -X POST https://your-domain.com/.agent/inbox \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_TOKEN" \ -d '{ "from": { "agent": "test-agent" }, "action": "get_support", "parameters": { "topic": "setup help" } }'Development
Section titled “Development”pnpm installpnpm run dev # Start local dev serverpnpm run deploy # Deploy to CloudflareImplement it yourself
Section titled “Implement it yourself”You don’t need Cloudflare — or any specific platform — to adopt agent.json. The protocol is three HTTP endpoints:
GET /.well-known/agent.json— serve a static JSON discovery documentPOST /.agent/inbox— accept messages and route them however you wantGET /.agent/inbox/:id— return message status and responses
You can implement these in Express, Next.js, Django, Rails, Go, or anything else that handles HTTP. The Protocol section documents every field, and the Integration guides show how agents call these endpoints from any language.