---
title: "Pennylane API: connect it to a tool built with AI (2026)"
url: https://while.sh/en/guides/connect-pennylane-api-ai-tool/
author: "Aloïs Oddon, co-founder of Nextmap"
updated: 2026-11-18
---

# Connect Pennylane to a tool built with Claude or ChatGPT (2026)

Your tool built with Claude needs to read Pennylane's invoices to track unpaid bills or cash flow. The Pennylane token opens the company's accounting, and it must end up neither in the code nor in the conversation. On while, it stays in while, and your AI never sees it. Here is how.

Pennylane holds the accounting, the customer and supplier invoices, the bank reconciliations. A tool built with Claude or ChatGPT becomes valuable when it **reads that data**. It shows the overdue invoices to chase, the week's cash flow, revenue by customer. To do that, it needs a **Pennylane API token**, and that token opens the accounting of the whole company.

That is where things often go wrong: **the token ends up pasted into the code**, or into the conversation with the AI, where it can leak. On while, the Pennylane token **stays in while**. The tool calls Pennylane without ever holding it, and your AI never sees it.

> **The short version.** Generate a company token in Pennylane, read only if the tool writes nothing. Ask your AI to connect Pennylane, then paste the token into while through the link it gives you. The tool reads your invoices, every call is logged, and a write waits for the rule you approve.

## What you need before you start

Two conditions come from Pennylane, and they take a minute to check (source 1).

- **The Essential plan or higher.** On the Starter plan, the Developers tab does not appear in the settings.
- **The right to administer the company.** The executive, the internal accountant and the external accountant can create a token. If the tab is missing, ask one of them.

A token is always tied **to a single company**. If you track several in Pennylane, each one has its own token (source 1).

## Connect Pennylane to your tool, in three steps

The whole thing takes a few minutes, and you have no code to write.

1. **Generate a token in Pennylane.** Open the company settings, then Connectivity and Developers, and click Generate an API Token. Give it a name that says what it is for, like "Payment reminders tool". Choose **Read only** if the tool only reads, and a duration: 1 month, 6 months, 12 months or unlimited (source 1).
2. **Ask your AI to connect Pennylane.** It declares the connection in while and gives you a link.
3. **Paste the token into while.** Pennylane shows it **only once**: copy it, open your AI's link, paste it and confirm. Neither your AI nor the tool's code sees it.

> You, to your AI: Connect Pennylane to this tool, read only, and show the customer invoices more than 30 days overdue, sorted by amount.

<figure class="illus"><img src="/illustrations/pennylane-relais-1200.webp" srcset="/illustrations/pennylane-relais-768.webp 768w, /illustrations/pennylane-relais-1200.webp 1200w" sizes="(min-width: 48rem) 46rem, 100vw" width="1536" height="1024" loading="lazy" decoding="async" alt="The tool built with AI calls the Pennylane API through while: the company token is added to each call inside while, out of the code, every read of the invoices is logged and a write to the accounting waits for the rule a person approves" /><figcaption>The tool calls Pennylane through while, which adds the token to each call.</figcaption></figure>

## What while does on each call

The tool calls Pennylane **through while**, without a token. while adds the token to each call, and logs it in the history. For the first seven days, reads go through and teach while what the tool calls. **A write**, like creating an invoice or a customer, goes through once you approve its rule. After that, an unexpected call is refused, and your AI is told.

For accounting, caution makes sense. You can ask for your approval before a sensitive call.

> You, to your AI: Ask me before every invoice creation in Pennylane.

Pennylane accepts **up to 25 requests every 5 seconds** per token (source 3). A tool that reads the week's invoices stays far below that, and your AI takes it into account when it builds the tool.

The credentials of your software are detailed on our [security](/en/security/) page, and the same mechanism works for any API in [connect an API with no credentials in the code](/en/guides/api-keys-out-of-code/).

## When the token expires

A 1, 6 or 12 month token expires on its date. Generate a new one in Pennylane, then **paste it into while**: the tool uses it from the next call, without being put back in place, and your AI has nothing to redo. Then delete the old one in the Developers tab, where Pennylane also shows when each token was last used (source 1).

## What while adds around it

- **Your colleagues** use the tool with a while account for up to 3 people, or, on the Pro plan, with their email account, Google or Microsoft. See [keep a tool for your colleagues](/en/guides/internal-tool-company-sign-in/).
- **Your accountant** can use it with [an access link and a password](/en/guides/share-app-with-password/), valid for 1, 7 or 30 days.
- **Connected software**: one on the Libre plan, and 25 on the Pro plan, Pennylane included.
- **The tool's data** is backed up every day, and your tools are hosted in France by Nextmap.

For tool ideas around your numbers, see [the quote tracker](/en/guides/quote-tracker-small-business-ai-2026/) and [expense reports](/en/guides/expense-tracker-small-business-ai-2026/), and for a related connection, [connect Google Sheets](/en/guides/connect-google-sheets-ai-tool/).

## Try it with your tool

Give this message to your AI, then ask it to connect Pennylane. The trial is **free, with no sign-up**, and your tool has its address **in 3 minutes**.

```text titre="The message to give your AI"
Read while.sh/agents and help me get started with while.
```

## Sources

1. [Pennylane, Create a Company API Token](https://pennylane.readme.io/docs/authentication), 2026-11-18
2. [Pennylane, Getting started](https://pennylane.readme.io/docs/getting-started), 2026-11-18
3. [Pennylane, Rate limiting in API v2](https://pennylane.readme.io/docs/rate-limiting-1), 2026-11-18

## Questions

### How do you get a Pennylane API token?

In Pennylane, open the company settings, then Connectivity and Developers, and click Generate an API Token. Choose read only or read and write, then an expiration date (source 1).

### Which Pennylane plan do you need to use the API?

The Essential plan or higher. On the Starter plan, the Developers tab does not appear (source 1).

### Who can create an API token in Pennylane?

The people who administer the company in Pennylane: the executive, the internal accountant and the external accountant (source 1).

### Does my AI see the Pennylane token?

No. Your AI declares the connection to Pennylane and gives you a link. You paste the token into while there, and neither your AI nor the tool's code sees it.

### What do you do when the Pennylane token expires?

Generate a new one in Pennylane and paste it into while. The tool uses it from the next call, without being put back in place. Pennylane shows a token only once, and it cannot be retrieved later (source 1).

### How many calls does the Pennylane API accept?

Up to 25 requests every 5 seconds per token. Beyond that, Pennylane answers with a 429 error and says when to retry (source 3).
