# Claude Claude integration with Ritevo: API key, model, system prompt and token limit, automatic AI replies in messages, reconnecting. The Claude integration lets you reply to customers in messages with text written by a Claude model. You connect it with your own API key from Anthropic Console - you pay for usage directly to the provider. > **Required integration:** You need a Anthropic Console account with credit and an API key. You can add as many Claude integrations as you like, including several with the same API key - for example with a different model or system prompt for different channels. Each works on its own. Uniqueness is not checked, on purpose: every create call makes a new integration, also for the same `externalId`, so one account can have several integrations with different details or settings. You provide a new key with `PATCH /integrations/ai/claude/{id}/token` - in any state of the integration. It sends the provider a test request and sets `authError=false` and `active=true`. A wrong key on create or key change returns `INVALID_TOKEN`, any other provider error `EXTERNAL_EXCEPTION`. ## How to generate the API key You create the key in Anthropic Console. Copy it straight away - the key is shown only once. 1. Sign in at console.anthropic.com. 2. Go to **API Keys** and click **Create Key**. 3. Copy the key. ## Connecting the account Start in Ritevo: 1. Go to **Integrations** in the left panel and click **Add integration** in the top right corner. 2. In the **Artificial intelligence** section pick the **Claude** tile. 3. In the **Account name** field enter your own name for the integration, paste the **API Token** and pick the **Model**. 4. In the **Advanced settings** card enter the **System prompt** and set **Max tokens** - described below. 5. Click **Create integration**. We send Claude a short test request with this key and model right away: if it works, the integration is added and its settings open. If not - you will see an error and nothing is saved. ![The integrations list in Ritevo with the Add integration button in the top right corner framed](https://ritevo.com/docs/integrations/en-integrations-list.webp) ![The Add integration screen with the Claude tile framed in the Artificial intelligence section](https://ritevo.com/docs/integrations/claude/en-catalogue.webp) ![The Claude add screen with the Account name, API Token, Model, System prompt and Max tokens fields](https://ritevo.com/docs/integrations/claude/en-add.webp) ## Integration settings On the integration page you will find the fields below. You save changes with **Update integration**: - **Account name** - your own name for the integration. You pick the integration by this name in an automatic action. - **Model** - the Claude model that writes the replies: claude-sonnet-4-5-20250929, claude-sonnet-4-20250514, claude-opus-4-20250514, claude-haiku-4-5-20251001 or claude-3-5-haiku-20241022. - **System prompt** - the instruction for the AI added to every reply: who you are, what tone to use, opening hours, return rules, which language to answer in. It is the only place where you give the AI knowledge about your business. - **Max tokens** - the upper limit on reply length. 1000 by default. Too low a limit cuts the reply off halfway and the customer gets it truncated. - **Update token** - you enter a new API key. ![Claude integration details: account name, model, system prompt, max tokens and the Update token and Update integration buttons](https://ritevo.com/docs/integrations/claude/en-details.webp) Integration fields: `accountName`, `apiToken` (on create only), `model` = `claude-sonnet-4-5-20250929`, `claude-sonnet-4-20250514`, `claude-opus-4-20250514`, `claude-haiku-4-5-20251001`, `claude-3-5-haiku-20241022`, `systemPrompt` (up to 10000 characters) and `maxTokens`. Changing settings: `PUT /integrations/ai/claude/{id}` with these fields without `apiToken` - saving also sets `active=true`. ## AI replies in messages The AI integration works in message actions, in the **Send AI message to thread** step. Step details and a ready example are in [Message actions](https://ritevo.com/en/docs/automations/message-actions#ai-reply-example). - **What the AI gets** - the text of the latest message in the thread and the **System prompt**. It does not get the earlier conversation history or order data. - **Sending** - the reply goes to the customer right away, without approval. - **Error** - when the AI provider returns an error, nothing is sent and the action stops. You see the error in the message audit. - **Costs** - every reply is billed to your account with the AI provider. Adding the integration and changing the key send one short test request. > **Good to know:** In an action with the **Send AI message to thread** step, set the **Message received from customer** condition. The AI replies to the latest message in the thread, so without this condition it could reply to its own replies. Message actions: the **Send AI message to thread** step is `AI_SEND_MESSAGE_TO_THREAD` in `actionSteps[].action.type`, with `uuidValue` = the AI integration id (`GET /integrations/ai`). The **AI reply in thread** trigger is `triggerType` = `AI_MESSAGE_RESPONSE`, and the **Message received from customer** condition is `MESSAGE_FROM_INTERLOCUTOR`. The model gets the text of the latest message in the thread (whoever wrote it) as the only user message plus the integration's `systemPrompt`. Full description: [Message actions](https://ritevo.com/en/docs/automations/message-actions). ## Reconnection required This state shows up when Claude rejected the API key while writing a reply - for example after the key was deleted. Until you enter a new key, the AI will not reply to customers. 1. Create a new API key in Anthropic Console. 2. On the integration page click **Update token**, paste the key into the **API Token** field and confirm. We check it with a short test request - a valid one refreshes the connection, and the settings stay unchanged. ![The Update token window of the Claude integration with the API Token field](https://ritevo.com/docs/integrations/claude/en-update-token.webp) > **Good to know:** Reconnecting clears the **Reconnection required** state straight away and turns the integration on - also when it was deleted earlier. You do not need to restore it separately. In the API, reconnecting sets `authError=false` and `active=true` on the integration, also when it was deleted (`active=false`). Which endpoint does it for a given integration is described in the uniqueness note at the top of the page. ## Deleting the integration **Delete integration** turns the integration off in Ritevo: it stops fetching and sending data, but what it fetched earlier stays. **Restore integration** turns it back on. ## What the integration does not do - It does not suggest replies to insert by hand - it replies only through an automatic action. - It does not read the conversation history or order data. - It does not save replies as drafts for approval. - It does not cap spending - you set limits in your account with the AI provider. ## The integration through the API This integration's endpoints are under `/integrations/ai/claude`, and the ones shared by the whole type (list, get one, delete, restore) under `/integrations/ai`. The current paths, fields, types and response codes are always in Swagger: https://api.ritevo.com/api/v1/api-docs. --- All help in one file: https://ritevo.com/llms-full.txt. Help map with links to every page: https://ritevo.com/llms.txt.