Skip to content
Skip to content
PGB Learn

Bring your own AI key and track usage

Add your AI provider key on the AI keys page, test the connection, and read the Usage page to see what your agents cost.

Updated Nov 12, 2026

Agents need an AI provider to think. For most accounts, you provide your own key. PGB's shared AI capacity is not generally open: unless your account has been given an allowance, a run without your own key stops with "Add your own AI provider key to use this feature."

Add a key

  1. Get an API key from your AI provider's website. Create one just for PGB so you can revoke it independently.
  2. In Agents, open AI keys.
  3. Under Add a key, pick the Provider from the list.
  4. Paste the Key.
  5. Choose Check and save.

The key is verified with a small test call that does not use up tokens. A key the provider rejects is not saved. After saving, it is stored encrypted and only the last four characters are ever shown, like ••••a1b2.

Test the connection

Choose Test connection at the top of the page. A green message, "Test passed: your agents can reach a model.", means runs can start. A red message tells you what to fix.

Remove or replace a key

Under Your keys, choose Remove next to a provider and confirm. Agents using it stop until you add another. To replace one, add a new key for the same provider.

Who pays

Your provider bills you directly for the tokens your agents use. PGB does not add a charge for runs made with your own key. Spend is still limited by each agent's budget. See Set budgets and know when a run will stop.

The same key is used by PGB Studio's AI builder, because it belongs to your account.

Read the Usage page

Open Usage. Pick Last 7 days, Last 30 days or Last 90 days.

  • Four totals: Runs, Tokens in, Tokens out and Cost.
  • Cost per day: a bar chart. Hover a bar for the date, cost and number of runs.
  • A table per agent with runs, tokens, cost and This month / budget.

Good to know

  • Cost on this page is an estimate from token counts and a price list. Your provider's invoice is authoritative.
  • If you see a message saying you have reached your AI usage limit, try again later.
  • Never share your key in instructions, chat or support requests.

More guides in PGB Agents