# AI credits

> Prepaid credits pay for AI on Lagotto's key at cost, with no markup. How to buy them, set up automatic top-up, and what happens when they run out.

When your workspace runs AI on Lagotto's key, each run is paid from prepaid AI credits: a balance in dollars that you buy ahead. Credits are spent at the model's list price, with no markup. On your own Anthropic or OpenAI key, no credits are used at all. Administrators (owners and admins) buy credits under **Settings → Billing**. To choose whose key AI runs on, see [Setting up AI](https://www.lagottolabs.ai/support/ai/setting-up-ai.md).

## What uses credits

Every AI run on Lagotto's key: drafts, translations, summaries, and pull requests written for fixes your team approved. A run costs the tokens it used at the model's list price. You can see what each one cost:

- on a ticket, under **How this was written** in the **AI draft** panel
- under **Settings → AI → Usage**, every run with its cost
- in the credit ledger, every amount taken

On your own key, runs are listed the same way, but nothing comes out of your credits.

## Your balance

- **Settings → AI → Credits** shows the **Balance** and the **Ledger**: every credit added and spent, marked **Purchase**, **Usage**, **Adjustment** or **Refund**. Usage entries link to their ticket. Entries are never edited or removed.
- **Settings → Billing** has an **AI credits** card with the balance, **Spent this month**, buying, automatic top-up and your recent purchases. **Credit ledger** opens the full ledger.

On Lagotto's key, when the balance drops under $5, the Credits tab warns that credits are running low.

## Buying credits

Your plan must be set up first. Then:

1. Go to **Settings → Billing**.
2. In the **AI credits** card, under **Buy credits**, choose **$50**, **$100**, **$250** or **$500**. For another amount, choose **Other** and type anything from $10 to $10,000.
3. Press **Buy credits**. Stripe's secure checkout page opens.
4. Pay. You come back to the Billing page.

The credits are added once the payment is confirmed, usually within a minute: refresh the page to see them. A payment that takes longer to clear adds its credits when it clears. The purchase shows in the ledger as "Credit purchase".

The card you pay with is kept. It becomes the card for automatic top-ups and, if your plan is charged to your card, for your invoices. To use a different card later, change it under **Manage payment method**: see [Changing the card](https://www.lagottolabs.ai/support/billing/plan-and-invoices.md#changing-the-card).

## Automatic top-up

Automatic top-up buys more credits when the balance runs low, so AI doesn't stop mid-day. It needs a card on file: buy credits once, or add a card under **Manage payment method** if the Billing page shows it.

1. Go to **Settings → Billing**, to **Automatic top-up** in the **AI credits** card.
2. Turn on **Top up automatically**.
3. In **When the balance drops below ($)**, enter the balance that should trigger a top-up.
4. In **Buy this much ($)**, enter the amount to buy each time, from $10 to $10,000.
5. Press **Save**.

The balance is checked each time AI spends credits, and also when you save these settings, when you change the card under **Manage payment method**, and when AI would run but the balance has reached zero. When it is under your amount, Lagotto charges the card on file, and the credits appear in the ledger as "Automatic top-up". Only one top-up runs at a time.

If the balance is already under your amount when you save, the top-up starts right away, and the Billing page says so.

### When a top-up fails

A top-up fails when the card is declined, or when the bank wants the cardholder to confirm the payment.

- The owners of your workspace get an email, "We couldn't top up your AI credits".
- Lagotto tries again the next time credits run low, but not within a day of the last try, unless you change the card.
- After 3 failed top-ups in a row, automatic top-up switches itself off. The owners get an email saying so, the Billing page shows it, and the audit log records it.

To fix it, change the card under **Manage payment method**, or buy credits with a card that works: either way, that card becomes the one on file. A changed card is tried straight away if a top-up is due. If automatic top-up switched itself off, turn **Top up automatically** back on.

## When credits run out

At zero, AI on Lagotto's key stops, and **Settings → AI** and every ticket's **AI draft** panel say "This workspace is out of AI credits." Until credits are added:

- no drafts, translations or summaries are written, and messages and tickets from that time aren't translated or summarized later
- everything else in Lagotto carries on as usual

With automatic top-up on, the next message from a customer starts a top-up. With **Draft a reply when a customer writes** on (under **Settings → AI**), that message's draft follows about a minute later, once the top-up has gone through. If the card is declined, see [When a top-up fails](https://www.lagottolabs.ai/support/billing/ai-credits.md#when-a-top-up-fails).

A run already under way stops before its next step. Each step is paid when it finishes, so the balance can end slightly below zero; your next purchase covers that first.

To keep AI running without credits, switch to your own key.

## Refunds and adjustments

- If a credit purchase is refunded, the refunded amount comes off your balance as a **Refund** entry, never more than that purchase added. To ask about a refund, [talk to us](https://www.lagottolabs.ai/contact/new).
- Credits Lagotto adds or removes by hand show as **Adjustment**, with the reason.

## Credits and invoices

Credits are prepaid and separate from your plan. They never appear on an invoice. See [How usage is counted](https://www.lagottolabs.ai/support/billing/how-usage-is-counted.md).
