> For the complete documentation index, see [llms.txt](https://docs.pixeleyes.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pixeleyes.de/anleitungen-instructions/english/documentation-of-our-shopware-6-plugins/log-watch-with-ai-analysis-and-ticket-workflow/api-keys-and-budget.md).

# Api keys and budget

AI analysis is optional and runs only on demand. To use it, you need an **API key** from your selected provider.

{% hint style="warning" %}
API access is billed **separately from the ChatGPT/Claude subscription** through pay-as-you-go billing or prepaid credits.

Treat every API key like a password: do not share it or include it in screenshots or tickets. Always set a **spend limit** before actively using AI.
{% endhint %}

***

## OpenAI (ChatGPT) – create a key

The API key does **not** come from the ChatGPT app. Create it on the developer platform.

{% stepper %}
{% step %}

## Open the OpenAI platform

Open **<https://platform.openai.com>** and sign in or register.
{% endstep %}

{% step %}

## Add payment details and credit

Go to **Organization → Settings → Billing → Overview**.

* Select **Add payment details** to add a payment method.
* Buy a small amount of **credit**—the minimum is usually $5, for example $10.
* Without credit, the API does not work.
* For **Business address**, a German company uses **DE VAT** (VAT ID in the format `DE` + 9 digits).
  {% endstep %}

{% step %}

## Create the API key

Open **<https://platform.openai.com/api-keys>**.

Select **Create new secret key**, enter a name such as `PixelLogGuard`, and confirm.
{% endstep %}

{% step %}

## Copy the key

Copy the key beginning with `sk-…` immediately.

{% hint style="warning" %}
The key is shown only once.
{% endhint %}
{% endstep %}
{% endstepper %}

### OpenAI – set the spend limit

#### a) Spend limit (soft monthly limit)

Go to **Settings → Billing → Usage limits** and select **Set monthly budgets**.

* Set the **Organization spend limit** using **Edit spend limit** to a small amount, such as **$20**.
* Add **Spend alerts**, for example warning emails at 50% and 80%.
* Note: “Actual costs may exceed this”—the limit is soft, so in-flight requests can slightly exceed it.

#### b) Credit / auto-reload (hard limit)

When buying credit, open the **Configure payment** dialog:

* **Auto-reload OFF** is the hardest limit: only purchased credit is spent, then the API stops.
* Or turn **Auto-reload ON** and enable **Monthly reload limit**, set to a low amount such as **$20**, to cap automatic top-ups per month.

{% hint style="success" %}
**Recommendation:** Turn auto-reload off, buy a small credit amount such as $10, and set a $20 spend limit. This lasts a long time for Log watch because analyses typically cost only cents.
{% endhint %}

### OpenAI – rate limits

Under **Limits**, you can also find rate limits such as TPM, RPM, and RPD, plus usage tiers.

These limit **speed**, not spending. Even the lowest tier is sufficient for Log watch because the plugin only sends requests when you click.

***

## Anthropic (Claude) – create a key

{% stepper %}
{% step %}

## Open the Anthropic Console

Open **<https://console.anthropic.com>** and sign in.
{% endstep %}

{% step %}

## Add payment details and credit

Go to **Settings → Billing**.

Add a payment method and top up credit.
{% endstep %}

{% step %}

## Create the API key

Go to **Settings → API Keys**.

Select **Create Key**, enter a name, and confirm.
{% endstep %}

{% step %}

## Copy the key

Copy the key beginning with `sk-ant-…` immediately.

{% hint style="warning" %}
The key is shown only once.
{% endhint %}
{% endstep %}

{% step %}

## Note the workspace ID if required

For **identity-linked** keys, you may see the message `anthropic-workspace-id is required`.

If so, note the workspace ID from the console. You will enter it later in the optional **Workspace ID** field.
{% endstep %}
{% endstepper %}

### Anthropic – set the spend limit

Under **Settings → Billing** or **Limits**, set spend limits and notifications.

Set a small monthly cap and only load as much credit as you want to spend.

***

## Enter it in the plugin

Go to **Log watch → Configuration → AI provider**.

{% stepper %}
{% step %}

## Choose the provider

Select **OpenAI ChatGPT** or **Anthropic Claude**.
{% endstep %}

{% step %}

## Enter the API key

Paste the matching API key:

* OpenAI: `sk-…`
* Anthropic: `sk-ant-…`
  {% endstep %}

{% step %}

## Add the Workspace ID if needed

For Claude, optionally enter the **Workspace ID**—only if required.
{% endstep %}

{% step %}

## Enable the provider

Turn on the **active switch**.
{% endstep %}

{% step %}

## Choose a model

Select a model, for example a current chat model.

For Claude:

* **Opus** provides the strongest quality.
* **Haiku** is the cheapest option.
  {% endstep %}

{% step %}

## Set the optional plugin budget

Optionally configure the **monthly budget (€)**.

This blocks AI analysis on the plugin side once estimated usage reaches the limit, providing additional protection on top of the provider limit.
{% endstep %}

{% step %}

## Save and test the connection

Save your settings, then go to **Dashboard → Test connection**.
{% endstep %}
{% endstepper %}

## Cost estimate vs. real account

{% hint style="warning" %}
The amount shown in the plugin—dashboard **usage** and detail **cost**—is an **estimate**.
{% endhint %}

The estimate is calculated at the time of the AI call using the tokens reported by the provider multiplied by the configured price fields in **€ per 1M tokens**.

* **Enter prices per model.** If the price fields are `0`, or do not match the model currently in use, the estimate displays **€0 or an incorrect value** even though real costs accrue. Enter the current price for your model from the provider account, and adjust it when you switch models.
* **Prices change.** Providers regularly adjust their prices, so check them from time to time.
* **The provider account is authoritative.** Binding billing is visible only in your OpenAI or Anthropic account. The plugin value is only a guide and the basis for the plugin’s budget brake.
* We cannot guarantee that the AI service always returns correct price or token information. The estimate may therefore differ.

## Double cost protection

* **At the provider:** Use a small credit amount, turn auto-reload off or cap it, and set a spend limit with warning emails.
* **In the plugin:** Set a monthly budget (€). AI analysis never runs automatically—it only runs on demand.
