> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# StripeAgentToolkit integration

> Integrate with the StripeAgentToolkit tool using LangChain Python.

This guide provides a quick overview for getting started with Stripe's agent toolkit.

You can read more about `StripeAgentToolkit` in [Stripe's launch blog](https://stripe.dev/blog/adding-payments-to-your-agentic-workflows) or on the project's [PyPI page](https://pypi.org/project/stripe-agent-toolkit/).

## Overview

### Integration details

| Class                | Package                                                                 | Serializable | [JS Support](https://github.com/stripe/agent-toolkit?tab=readme-ov-file#typescript) |                                               Version                                              |
| :------------------- | :---------------------------------------------------------------------- | :----------: | :---------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: |
| `StripeAgentToolkit` | [`stripe-agent-toolkit`](https://pypi.org/project/stripe-agent-toolkit) |       ❌      |                                          ✅                                          | ![PyPI - Version](https://img.shields.io/pypi/v/stripe-agent-toolkit?style=flat-square\&label=%20) |

## Setup

This externally-managed package is hosted out of the `stripe-agent-toolkit` project, which is managed by Stripe's team.

You can install it, along with langgraph for the following examples, with `pip`:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pip install --quiet -U langgraph stripe-agent-toolkit
```

### Credentials

In addition to installing the package, you will need to configure the integration with your Stripe account's secret key, which is available in your [Stripe Dashboard](https://dashboard.stripe.com/account/apikeys).

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import getpass
import os

if not os.environ.get("STRIPE_SECRET_KEY"):
    os.environ["STRIPE_SECRET_KEY"] = getpass.getpass("STRIPE API key:\n")
```

It's also helpful (but not needed) to set up [LangSmith](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=oss-python-integrations-tools-stripe) for best-in-class observability:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
os.environ["LANGSMITH_TRACING"] = "true"
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass()
```

## Instantiation

Here we show how to create an instance of the Stripe Toolkit

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from stripe_agent_toolkit.langchain.toolkit import StripeAgentToolkit

stripe_agent_toolkit = StripeAgentToolkit(
    secret_key=os.getenv("STRIPE_SECRET_KEY"),
    configuration={
        "actions": {
            "payment_links": {
                "create": True,
            },
        }
    },
)
```

## Agent

Here's how to use the toolkit to create a basic agent in langgraph:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_anthropic import ChatAnthropic
from langchain.agents import create_agent


model = ChatAnthropic(
    model="claude-sonnet-4-6",
)

langgraph_agent_executor = create_agent(model, stripe_agent_toolkit.get_tools())

input_state = {
    "messages": """
        Create a payment link for a new product called 'test' with a price
        of $100. Come up with a funny description about buy bots,
        maybe a haiku.
    """,
}

output_state = langgraph_agent_executor.invoke(input_state)

print(output_state["messages"][-1].content)
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/tools/stripe.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
