# Use your own Claude AI key

The Claude AI integration holds an Anthropic API key that PiGi uses for its AI features: the WhatsApp chatbot and reading photographed documents such as licence cards, receipts and vehicle papers. Adding your own key bills that usage to your Anthropic account; you need a Claude Console account with credit.

Source: https://help.pigi.io/guides/integrations/ai-and-automation/claude-ai

## Quick answers

**What does Claude AI power in PiGi?**
The WhatsApp chatbot that answers customers about their booking, and the document
reader that fills in forms from a photo — a driver's licence card, a fuel or workshop
receipt, a vehicle licence disc or finance agreement, and a service invoice. It also
suggests categories for agents.

**Do I have to add my own key?**
Not always. Without a school key, these features use PiGi's own key where PiGi has
one set up. Adding your own key means the usage is billed to your Anthropic account,
and the features keep working on your key regardless of PiGi's.

**Where do I get a key?**
Sign in at platform.claude.com, go to **Settings → API keys**, click **Create key**,
and copy the key. It starts with `sk-ant-` and is shown only once.

**Where do I enter the key?**
Company → Settings → Integrations → **Claude AI** → **Connect Claude AI** → **Add
credentials**. Paste it into **API Key** and click **Save**, then run **Test
connection**.

**What does it cost?**
Anthropic charges per use from your account's credit balance. See Anthropic's pricing
page. PiGi adds no charge on top.

**The document reader says my school's key was rejected. What now?**
Open the Claude AI integration, paste a working key under **Update credentials** and
run **Test connection**. Or disconnect it to fall back to PiGi's key.

**Does adding a key switch the chatbot on?**
No. The chatbot has its own switch: Bookings → Settings → **AI Chatbot** →
**Configuration** → **Enable Chatbot**.

## What this does

The Claude AI integration stores one Anthropic API key for your school. Whenever PiGi
asks Claude to read a document or reply to a customer for you, it uses that key. The
document reader only proposes values — the person scanning always checks and saves
them.

## Before you start

- The **admin** role in PiGi.
- A Claude Console account at platform.claude.com with billing set up and credit on
  it.
- For the chatbot: WhatsApp connected and your chatbot knowledge entries written
  under Bookings → Settings → **AI Chatbot**.

## Set up Anthropic

1. Sign in, or create an account, at platform.claude.com.
2. Add billing details and buy credit under the Console's **Billing** page.
3. Go to **Settings → API keys** and click **Create key**.
4. Name it (for example "PiGi"), choose an expiry, and scope it to a single workspace.
   Prefer a service account key, which keeps working if the person who created it
   leaves your organisation.
5. Copy the key now — the Console never shows it again.

## Connect it to PiGi

1. Open **Company → Settings → Integrations** and click the **Claude AI** tile in
   **AI & automation**.
2. Click **Connect Claude AI**.
3. Click **Add credentials**, paste the key into **API Key**, and click **Save**.
4. Click **Test connection**.
5. For the chatbot, go to **Bookings → Settings → AI Chatbot**, click
   **Configuration**, turn on **Enable Chatbot**, choose the **AI Model**, and click
   **Save Configuration**.

## Test it

- **Test connection** should show "Connection works" with "API key valid".
- Scan a document where the reader is offered — for example a receipt — and check
  the fields fill in.
- For the chatbot, send a WhatsApp message to your business number from a phone
  linked to a test booking and check the reply.

## Troubleshooting

| What you see | What to do |
|---|---|
| "Connection failed" with "invalid x-api-key" or similar | The key is wrong or revoked. Create a new key and save it. |
| A billing or credit message | Top up credit on the Console's Billing page. |
| "The document reader isn't set up for this school yet…" | Add a Claude AI key, or ask PiGi support whether PiGi's own key is available. |
| "Anthropic rejected this school's Claude AI key…" | Update the key, or disconnect it to use PiGi's key. |
| "The document reader is unavailable right now…" | Anthropic is busy or down. Try again in a minute, or type the details in. |
| Key works in Test but fails elsewhere | Make sure the key is limited to one workspace. |

## Known limitations

- A school key that stops working is not backed up by PiGi's key — fix or disconnect
  it.
- The chatbot replies only through a WhatsApp number connected by QR code, not
  through WhatsApp Business Cloud.
- The chatbot offers two Claude models.
- The document reader proposes values; it never saves without someone confirming.

## Sources

- [Get your Claude API key — Claude Docs](https://platform.claude.com/docs/en/get-api-key)
- [API overview — Claude Docs](https://platform.claude.com/docs/en/api/overview)
