How I Put Claude AI on My Alexa (and You Can Too)
How I Put Claude AI on My Alexa (and You Can Too)
Build your own Alexa skill that talks to Claude in under an hour
I wanted to ask my Alexa random questions and get genuinely good answers. Not the usual "Here's what I found on the web" followed by a Wikipedia summary. Real answers. Thoughtful answers. Claude-quality answers.
So I built an Alexa skill called John Claude Van Dam that connects to Anthropic's Claude API. I ask Alexa a question, it hits Claude, and Alexa reads back a concise, natural-sounding answer. No screen needed. No app needed. Just voice in, answer out.
The best part: it routes to different Claude models depending on how you phrase the request. Quick question? It uses Haiku (fast and cheap). Need more depth? Say "sonnet" and it uses Claude Sonnet. Want the full brainpower? Say "opus" and it hits Opus.
Here's how it works in practice:
- "Alexa, ask John Claude van dam what colour is the sky" -- uses Haiku, answers in 2-3 sentences
- "Alexa, ask John Claude van dam sonnet explain how gravity works" -- uses Sonnet, answers in 3-5 sentences
- "Alexa, ask John Claude van dam opus is free will real" -- uses Opus, gives a nuanced 5-8 sentence analysis
Total cost to run: a few cents per month in API calls. The AWS Lambda compute is free tier. And you never need to publish or get approval -- dev mode skills work immediately on your own Alexa devices.
This post walks through exactly how to set it up. You don't need to write any code. I've packaged everything into two files you can download and upload directly.
What You Need Before You Start
- An Amazon Developer account -- free, uses your existing Amazon login
- An AWS account -- free tier is all you need
- An Anthropic API key -- sign up at console.anthropic.com
- Two files from this post:
van-dam-deploy.zip-- the Lambda function package (upload to AWS)alexa-interaction-model.json-- the voice interaction model (paste into Alexa console)
Download both files here:
the zip for Lambda here and
Password: hd7zjMDjnN2hghmS
The json for alexa : here and
Password: bEtYaXW3AJyjtpNN
How It Works (The Architecture)
The flow is simple:
- You speak to Alexa
- Alexa strips the wake word and invocation name, figures out the intent (Haiku/Sonnet/Opus), and extracts your question
- Alexa sends a request to an AWS Lambda function
- The Lambda function calls the Anthropic Claude API with your question and a system prompt tuned for voice responses
- Claude's response comes back to Lambda, which packages it for Alexa
- Alexa reads the answer aloud
The invocation name is "john claude" and the carrier phrase is "van dam". So when you say "Alexa, ask John Claude van dam what is the speed of light", Alexa strips "Alexa, ask John Claude" as the skill invocation, "van dam" is consumed as a carrier phrase, and Claude receives "what is the speed of light" -- your full, unclipped question.
The system prompt tells Claude to keep answers concise, never ask clarifying questions, never use formatting like bullet points or markdown (since it's being read aloud), and to always lead with the direct answer.
Step 1: Create the Lambda Function
The Lambda function is the backend that receives Alexa's request and calls the Claude API.
- Go to the AWS Lambda console: https://console.aws.amazon.com/lambda/
- Important: Make sure you're in the US East (N. Virginia) region -- check the top-right dropdown. Alexa skills require Lambda functions in specific regions, and us-east-1 is the safest bet. Your usual region won't work.
- Click Create function
- Select Author from scratch
- Function name:
john-claude-van-dam - Runtime: Python 3.12
- Click Create function
Upload the Code
- On your function's page, find the Code tab (should be selected by default)
- Click the Upload from dropdown (top right of the Code source section)
- Select .zip file
- Upload the
van-dam-deploy.zipfile - Click Save
Configure the Timeout
Lambda defaults to a 3-second timeout. Claude needs more time than that, especially Opus.
- Click the Configuration tab
- Click General configuration on the left
- Click Edit
- Change Timeout to 30 seconds
- Click Save
Add Your API Key
- Still in the Configuration tab, click Environment variables on the left
- Click Edit
- Click Add environment variable
- Key:
ANTHROPIC_API_KEY - Value: your Anthropic API key (starts with
sk-ant-) - Click Save
Copy Your Lambda ARN
At the top of your function page, you'll see the Function ARN. It looks like:
arn:aws:lambda:us-east-1:123456789012:function:john-claude-van-dam
Copy this. You'll need it in the next step.
Step 2: Create the Alexa Skill
- Go to the Alexa Developer Console: https://developer.amazon.com/alexa/console/ask
- Sign in with the same Amazon account that's linked to your Alexa devices at home. This is critical -- dev mode skills only appear on devices registered to the same account.
- Click Create Skill
- Name:
John Claude Van Dam - Locale: choose the one that matches your Alexa devices (e.g., English (Australia), English (US))
- Model: Custom
- Hosting: Provision your own
- Template: Start from Scratch
- Click Create
Set Up the Interaction Model
- In the left sidebar, click Interaction Model, then JSON Editor
- Delete everything in the editor
- Open the
alexa-interaction-model.jsonfile in a text editor, copy the entire contents, and paste it in - Click Save
- Click Build Model at the top -- wait for it to finish (usually under a minute)
Connect the Endpoint
- In the left sidebar, click Endpoint
- Select AWS Lambda ARN
- Paste your Lambda ARN (from Step 1) into the Default Region field
- Click Save Endpoints
- On this same page, you'll see your Skill ID displayed (starts with
amzn1.ask.skill.). Copy it.
Wire Up the Trigger (Back in AWS)
- Go back to your Lambda function in the AWS console
- Click Add trigger
- Select Alexa Skills Kit from the dropdown
- Paste your Skill ID
- Click Add
Both sides now know about each other. That's the full setup.
Step 3: Test It
In the Simulator
- Back in the Alexa Developer Console, click the Test tab
- Change the dropdown from Off to Development
- Type:
ask john claude van dam what is the speed of light - You should get a response from Claude via Haiku
On Your Devices
If your Alexa devices are signed into the same Amazon account as your developer account, the skill is already available. No publishing, no approval, no waiting. Just say:
"Alexa, ask John Claude van dam what colour is the sky"
If it doesn't work on a device but works in the simulator, check that the device's language setting matches the locale you chose when creating the skill. Go to the Alexa app on your phone: Devices, tap the speaker, Settings, and check Language.
How the Model Routing Works
The interaction model defines three intents, each mapped to a different Claude model:
| Trigger phrase | Model | Word limit | Best for |
|---|---|---|---|
| "van dam {question}" | Claude Haiku | 50-75 words | Quick factual questions |
| "van dam sonnet {question}" | Claude Sonnet | 75-120 words | Questions needing reasoning |
| "van dam opus {question}" | Claude Opus | 120-200 words | Deep, nuanced analysis |
The system prompt for each model enforces the word limit and tells Claude to always give a direct answer, never ask follow-up questions, and use natural spoken English. The max_tokens parameter acts as a hard backstop.
Cost
This is extremely cheap to run for personal use.
The Lambda function sits in AWS free tier (1 million requests per month free). Your only real cost is the Anthropic API.
At casual personal use of maybe 10-20 questions per day, mostly Haiku:
| Model | Input cost (per 1M tokens) | Output cost (per 1M tokens) | Rough cost per question |
|---|---|---|---|
| Haiku | $1 | $5 | ~$0.001 |
| Sonnet | $3 | $15 | ~$0.005 |
| Opus | $5 | $25 | ~$0.01 |
That's well under $1 per month for typical household use.
Things to Know
Alexa has an 8-second response timeout. Haiku and Sonnet respond well within this. Opus on a complex question could occasionally time out. If this happens, just try again -- the second attempt usually hits a warm Lambda instance and responds faster.
Cold starts add latency. If nobody has used the skill for a while, the first request takes longer because Lambda needs to spin up the Python runtime and load the packages. Subsequent requests are fast.
The invocation is a mouthful. "Alexa, ask John Claude van dam" is a lot of words before you get to your question. In practice you get used to it, and the payoff is that Claude receives your complete question without any words being stripped.
Your API key is in a Lambda environment variable. This is fine for personal use. If you ever want to share the skill publicly, move the key to AWS Secrets Manager instead.
Each question is independent. There's no conversation memory between requests. Every question starts fresh. You can't say "follow up on that" -- you'd need to ask a complete question each time.
The Code
If you want to understand or modify what's happening under the hood, the Lambda function (lambda_function.py inside the zip) is straightforward Python. It uses:
ask-sdk-core-- Amazon's official Python SDK for Alexa skillsanthropic-- Anthropic's official Python SDK for the Claude API
The key parts are the system prompt (which you can edit to change Claude's personality or response style), the model mapping, and the max token limits. Everything else is Alexa boilerplate.
Want Claude to be funnier? More Australian? More technical? Edit the _BASE_RULES string in the Lambda function and re-upload the zip.
What's Next
A few ideas for extending this:
- Progressive responses for Opus -- have Alexa say "Let me think about that..." while waiting for Opus to respond, buying more time before the 8-second timeout
- Conversation memory -- store exchanges in DynamoDB so Claude can handle follow-up questions
- Echo Auto in the car -- put an Echo Auto in your vehicle and you've got Claude on the road
- Cost tracking -- log model usage to CloudWatch to monitor your API spend
But honestly, the basic version is surprisingly useful as-is. Having Claude available by voice, anywhere there's an Alexa device, changes how often you reach for it. Questions you'd never bother typing out suddenly become worth asking.
Built with Claude. Obviously.

Comments
Post a Comment