# How to connect Stripe to AI agents?

Connect Stripe to Sequel with a read-only API key and ask about MRR, churn, refunds, and payouts in natural language.

Connect **Stripe** to Sequel and ask about your payments, revenue, and subscriptions in plain English — MRR, churn, refunds, disputes, payouts, and more — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). Stripe connects with a single API key, and Sequel only ever reads.

## What you'll need

- A **Stripe account** with access to the Dashboard.
- A **Stripe API key** — preferably a **Restricted Key** (starts with `rk_`) scoped **read-only** to the resources you want Sequel to query. A standard secret key (`sk_`) also works, but a restricted key is safer.

<Callout type="tip" title="Use a restricted, read-only key">
The Stripe connector ships only read tools (list, get, search). Pairing it with a Restricted Key scoped to read-only access means Sequel literally can't modify your account, even in principle. Scope the key to just the resources you care about (customers, charges, invoices, subscriptions, etc.), and revoke or rotate it from the Stripe Dashboard at any time without touching your other integrations.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **Stripe**.
</Step>

<Step title="Create a Restricted Key in Stripe">
In your Stripe Dashboard, go to **Developers → API keys → Create restricted key**. Set the resources you want Sequel to read (Customers, Charges, Invoices, Subscriptions, Products, Prices, Refunds, Disputes, Payouts, Balance) to **Read**, leave everything else **None**, and create the key. Use a `rk_test_…` key for test-mode data or `rk_live_…` for live data.
</Step>

<Step title="Paste the key into Sequel">
Copy the key from Stripe and paste it into the **API key** field on Sequel's Stripe connector.
</Step>

<Step title="Test and save">
Sequel verifies the key against the Stripe API. A green check means it's live.
</Step>
</Steps>

<Callout type="info" title="Test and live data stay separate">
Want both? Create two connections — one with a `rk_test_…` key and one with `rk_live_…`. Sequel keeps them isolated, and the connection name makes it obvious which is which.
</Callout>

## What you can query

Sequel exposes Stripe's core objects as read-only tools:

- **Customers** — find by email, metadata, or creation date.
- **Charges** and **Payment Intents** — including failed payments and their reason codes.
- **Invoices** and **Subscriptions** — by plan, price, status, or customer.
- **Products** and **Prices** — your catalog and pricing.
- **Refunds** and **Disputes** — over any period, by status.
- **Payouts** and **Balance Transactions** — what hit your bank and the fees behind it.
- **Balance** — current available and pending funds per currency.
- **Search** — full-text queries using Stripe Search Query Language (e.g. `email:"foo@bar.com"`, `status:"active" AND created>1700000000`) across customers, charges, invoices, subscriptions, products, prices, and payment intents.

## Try it

- "What's our MRR for May, broken down by plan?"
- "How many customers churned last month?"
- "List failed payment intents in the last 7 days with the failure reason."
- "What's our current available balance per currency?"

## Join it with other sources

Stripe is most powerful next to your product data. With a database also connected, ask:

> "For customers who churned in Stripe last month, what features did they use in our Postgres `events` table?"

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Invalid or expired key | Re-check the key for typos, or create a fresh Restricted Key in the Stripe Dashboard and paste it again. |
| A resource returns nothing or errors | The Restricted Key is missing **Read** permission on that resource — edit the key in Stripe and grant read access. |
| Data looks empty | Confirm there's actually data in the date range you're asking about, and that you used a live-mode key (`rk_live_…`) if you expect live data. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)
