Skip to main content
0 reactions

How to Use Claude in Rasa Pro (Anthropic Provider)

A designed card reading Rasa How-To: Use Claude in Rasa Pro, with a terminal window listing four ticked steps: ANTHROPIC_API_KEY, provider anthropic, claude-sonnet-5-5 and rasa train.
How to Use Claude in Rasa Pro (Anthropic Provider)

Rasa Pro can run your agent on Claude. You need two changes: your Claude API key in .env, and provider: anthropic in integrations.yml. This guide shows both, and how to check that your agent really talks to Claude.

It’s for agents built on Mantle, Rasa Pro’s LLM-native engine, which needs Rasa Pro 3.21 or later. Every step was run with Rasa Pro 3.21.4 and Claude Sonnet 5.5.

Cost: Claude is pay-per-use. Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens (Claude pricing (opens in a new tab)).

Step 1: Add Your Claude API Key to .env

Rasa reads your keys from the .env file in your project folder. If you don’t have a Claude API key yet, How to Get a Claude API Key (opens in a new tab) shows how to create one. Then, in your project folder, run this with your key in place of YOUR_CLAUDE_API_KEY:

TerminalBash
echo 'ANTHROPIC_API_KEY=YOUR_CLAUDE_API_KEY' >> .env

>> adds the line at the end of the file, so the keys already in it, such as your Rasa licence key, stay where they are.

Step 2: Set the Anthropic Provider in integrations.yml

Your agent’s LLM is set in integrations.yml, in a model group. Open the file in a text editor and change the model entry to Claude:

integrations.yml (excerpt)YAML
model_groups:
  - id: main_model
    models:
      - provider: anthropic
        model: claude-sonnet-5-5
        api_key: ${ANTHROPIC_API_KEY}
  • provider: anthropic sends the requests to Claude. Rasa hands any provider except openai, azure and self-hosted to LiteLLM, the library it uses to reach model providers (integrations.yml reference (opens in a new tab)).
  • model: is a Claude model ID, from the table below.
  • api_key: ${ANTHROPIC_API_KEY} reads your key from .env, so the key itself never sits in this file.
  • id: main_model is the group’s name. Keep the name that agent.yml uses under orchestrator.model_group.

Pick the model by what you need. Prices are per million tokens, from Claude’s pricing page (opens in a new tab):

Modelmodel: valueInput / output price
Claude Sonnet 5.5claude-sonnet-5-5$2 / $10
Claude Opus 5.5claude-opus-5-5$4 / $20
Claude Haiku 5.5claude-haiku-5-5$0.10 / $0.50

This guide was run with Claude Sonnet 5.5, which balances quality and price.

Step 3: Train Your Agent and Check It Uses Claude

TerminalBash
rasa train
rasa inspect

rasa train packs your agent with its new settings, and rasa inspect starts it and opens the Rasa Inspector in your browser. Send your agent a message, click Inspect at the top of the page, then click one of the LLM calls. Its panel names the model:

The LLM call panel in the Rasa Inspector: the model is claude-sonnet-5-5, the call took 1.7 seconds, the tools offered to the model are listed, and the start of the system prompt is shown.
The Inspector shows that the call went to claude-sonnet-5-5.

claude-sonnet-5-5 under Model means your agent is talking to Claude.

Clean Up

Press Ctrl+C in Terminal to stop the agent. Claude charges only for the calls your agent makes, so a stopped agent costs nothing.

Common Mistakes

MistakeDo this instead
Pasting the key into integrations.ymlKeep it in .env, and write ${ANTHROPIC_API_KEY} in integrations.yml.
Adding the key with > instead of >>> replaces .env and deletes your other keys. Use >>.
Writing the product name, such as Claude Sonnet 5.5, as the modelUse the model ID, such as claude-sonnet-5-5.
Renaming the model groupKeep the id that agent.yml names under orchestrator.model_group.

Troubleshooting

ProblemFix
Unknown model name 'claude-sonnet-5-5', using 'cl100k_base' encoding as fallbackHarmless: Rasa estimates prompt sizes with a tokenizer that doesn’t know Claude’s names. Here’s why.
missing a unique value for 'agent.id' on the first rasa trainHarmless: Rasa adds an id to agent.yml. Set your own id.
zsh: command not found: rasaTurn on your project’s virtual environment first: source .venv/bin/activate.

FAQ

Does Rasa support Claude officially?

Yes. Rasa’s integrations.yml reference has an Anthropic example with the same three lines. Its example uses an older model, claude-sonnet-4-6.

Do I still need an OpenAI key?

No. With the model group set to Anthropic, the agent calls Claude only. Rasa’s setup wizard asks for an OpenAI key, but you can leave it empty.

Can Claude also search my documents?

Not on its own. Mantle searches documents with an embedding model, and Anthropic doesn’t offer one (opens in a new tab), so references need a second provider for embeddings.

Conclusion

Using Claude in Rasa Pro takes a key in .env and three lines in integrations.yml: provider: anthropic, a Claude model ID and ${ANTHROPIC_API_KEY}. Train your agent, and the Inspector shows each call going to Claude.

Additional Resources

Rasa, Claude and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by Rasa Technologies or Anthropic.

0 comments