{"id":7771,"library":"stripe-agent-toolkit","title":"Stripe Agent Toolkit","description":"The Stripe Agent Toolkit is a Python library (current version 0.7.0) enabling popular agent frameworks like OpenAI's Agent SDK, LangChain, and CrewAI to integrate with Stripe APIs through function calling. It's built directly on top of the Stripe Python SDK, providing a subset of Stripe's API functionality to facilitate agentic workflows for payments, billing, and more. The library is actively maintained, with updates following the Stripe API's monthly minor releases and twice-yearly major releases.","status":"active","version":"0.7.0","language":"python","source_language":"en","source_url":"https://github.com/waldzellai/agent-toolkit","tags":["stripe","api","payments","agents","ai","langchain","openai","crewai","financial"],"install":[{"cmd":"pip install stripe-agent-toolkit","lang":"bash","label":"Install core package"},{"cmd":"pip install stripe-agent-toolkit[openai,langchain,crewai,strands]","lang":"bash","label":"Install with all optional dependencies"}],"dependencies":[{"reason":"Core functionality built on Stripe Python SDK.","package":"stripe"},{"reason":"Optional dependency for OpenAI's Agent SDK integration.","package":"openai","optional":true},{"reason":"Optional dependency for LangChain integration.","package":"langchain","optional":true},{"reason":"Optional dependency for CrewAI integration.","package":"crewai","optional":true}],"imports":[{"wrong":"from stripe_agent_toolkit import StripeAgentToolkit","symbol":"Configuration","correct":"from stripe_agent_toolkit import Configuration"},{"symbol":"Context","correct":"from stripe_agent_toolkit import Context"},{"symbol":"VERSION","correct":"from stripe_agent_toolkit import VERSION"}],"quickstart":{"code":"import asyncio\nimport os\nfrom stripe_agent_toolkit.openai.toolkit import create_stripe_agent_toolkit\n\nasync def main():\n    # It is strongly recommended to use a Restricted API Key (rk_*) for better security.\n    # Store your secret key securely, e.g., in an environment variable.\n    stripe_secret_key = os.environ.get('STRIPE_SECRET_KEY', 'sk_test_YOUR_TEST_KEY')\n\n    if not stripe_secret_key or stripe_secret_key == 'sk_test_YOUR_TEST_KEY':\n        print(\"Warning: Please set the STRIPE_SECRET_KEY environment variable \",\n              \"or replace 'sk_test_YOUR_TEST_KEY' with a real (test) key.\")\n        return\n\n    # Initialize the toolkit with your secret key and specify allowed actions.\n    # Tool availability is determined by permissions on the restricted key.\n    toolkit = await create_stripe_agent_toolkit(\n        secret_key=stripe_secret_key,\n        configuration={\n            \"actions\": {\n                \"payment_links\": {\n                    \"create\": True\n                }\n            }\n        }\n    )\n\n    try:\n        tools = toolkit.get_tools()\n        print(f\"Available Stripe Agent Tools: {[tool.name for tool in tools]}\")\n\n        # Example: Integrate with an agent framework (e.g., OpenAI's Agent SDK or LangChain)\n        # This part assumes an agent framework is set up to consume these tools.\n        # For a full agent example, refer to the Stripe Agent Toolkit documentation.\n\n        # In a real agent workflow, the agent would call these tools based on user prompts.\n        # For demonstration, let's pretend to call a tool.\n        if 'create_payment_link' in [tool.name for tool in tools]:\n            print(\"\\n'create_payment_link' tool is available. Your agent can now create payment links.\")\n            # Example of how an agent might use a tool (simplified representation):\n            # agent_response = await agent.run(\"Create a payment link for a product 'Premium Widget' for $25.00.\")\n            # print(agent_response)\n\n    finally:\n        # Clean up resources when done.\n        await toolkit.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates how to initialize the `stripe-agent-toolkit` with your Stripe secret key and configure its available actions. It emphasizes the use of Restricted API Keys (rk_*) for enhanced security and outlines how to retrieve the tools that an AI agent can then utilize. The example includes a basic setup, indicating where an agent framework would integrate with the toolkit's provided tools, and strongly recommends setting the Stripe API key via environment variables."},"warnings":[{"fix":"Create a Restricted API Key in your Stripe Dashboard (dashboard.stripe.com/apikeys) and assign only the minimum required permissions for your agent's tasks. Use this rk_ key instead of a full sk_ key.","message":"Always use Restricted API Keys (rk_*) in production for enhanced security and to limit the agent's access to only the necessary Stripe API functionality. Standard secret keys (sk_*) grant broad access.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official `stripe-agent-toolkit` documentation and examples to understand the supported Stripe API actions. If a required API is missing, consider contributing or using the raw Stripe Python SDK for that specific functionality outside the agent toolkit context.","message":"The Stripe Agent Toolkit does not expose the entire Stripe API. It provides a curated subset of functionalities relevant to agentic workflows. Attempting to access unsupported Stripe API features through the toolkit will result in errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Thoroughly test your agent in a sandbox environment (using Stripe's test mode keys) and implement robust error handling, monitoring, and human oversight mechanisms. Define clear boundaries for agent actions and consider explicit user confirmation steps for critical financial operations.","message":"Agent behavior can be non-deterministic. When integrating the toolkit with AI agents that perform financial transactions, unexpected outcomes can occur if not properly managed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"While `StripeAgentToolkit(...)` currently works, it's advisable to use the `create_stripe_agent_toolkit()` asynchronous factory function when available and appropriate for your agent framework, as shown in more recent quickstarts.","message":"Direct instantiation of `StripeAgentToolkit` via `StripeAgentToolkit(...)` might be replaced or augmented by asynchronous factory functions like `create_stripe_agent_toolkit(...)` in future major versions, especially for frameworks that benefit from async initialization.","severity":"deprecated","affected_versions":"Potentially future major versions (e.g., 1.0.0+)"}],"env_vars":null,"search_vec":"'0.7.0':14 'activ':66 'agent':2,6,17,22,56,87 'ai':88 'api':31,52,73,85 'bill':60 'built':37 'call':34 'crewai':26,91 'current':12 'direct':38 'enabl':15 'facilit':55 'financi':92 'follow':70 'framework':18 'function':33,53 'integr':28 'langchain':24,89 'librari':11,64 'like':19 'maintain':67 'major':82 'minor':76 'month':75 'openai':20,90 'payment':59,86 'popular':16 'provid':46 'python':10,44 'releas':77,83 'sdk':23,45 'stripe':1,5,30,43,50,72,84 'subset':48 'toolkit':3,7 'top':40 'twice':80 'twice-year':79 'updat':69 'version':13 'workflow':57 'year':81","created_at":"2026-04-16T14:12:41.634010+00:00","updated_at":"2026-04-16T14:12:41.634010+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.7.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://stripe.com","github":"https://github.com/stripe/ai","docs":"https://docs.stripe.com/mcp","changelog":null,"pypi":"https://pypi.org/project/stripe-agent-toolkit/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}