Send an email → get a Claude response back as a reply.
- You email the val's assigned address
- The val forwards your email text to the Anthropic Messages API
- Claude's response is emailed back to you as a reply
👉 Add ANTHROPIC_API_KEY here: https://www.val.town/x/jsomers/email-to-claude/environment-variables?key=ANTHROPIC_API_KEY
Get one at https://console.anthropic.com/settings/keys
👉 Add ALLOWED_SENDER here: https://www.val.town/x/jsomers/email-to-claude/environment-variables?key=ALLOWED_SENDER
Set this to your own email address so only you can trigger the val.
👉 Add CLAUDE_SYSTEM_PROMPT here: https://www.val.town/x/jsomers/email-to-claude/environment-variables?key=CLAUDE_SYSTEM_PROMPT
Copy your Claude.ai project's custom instructions here. Since the Anthropic API doesn't have direct access to Claude.ai projects, this is how you replicate the project's behavior.
👉 Add CLAUDE_MODEL here: https://www.val.town/x/jsomers/email-to-claude/environment-variables?key=CLAUDE_MODEL
Defaults to claude-sonnet-4-20250514. Other options: claude-opus-4-20250514,
claude-3-5-haiku-20241022, etc.
Just send a plain-text email to the special email address. The email body becomes the prompt. You'll get a reply with Claude's response.
- Each email is independent — there's no conversation history between messages (the API is stateless per call).
- HTML-only emails may not parse well; plain text works best.
- Max 30MB per incoming message (Val Town limit).