Stripe AI

repository·main·Indexed 23 days ago

https://github.com/stripe/ai

A collection of tools and SDKs designed to bridge Stripe's billing infrastructure with AI/LLM ecosystems. It includes the @stripe/ai-sdk (v0.1.3), which provides provider and metering utilities for the Vercel AI SDK, enabling developers to build AI-powered products with integrated billing, metering, and agentic capabilities.

Tokens
122.5K
Snippets
212
Records
549
Agent score
80%

What's inside Stripe AI

  1. Overview of Ruby SDK Upgrade problems

    main

    This evaluation tests the ability to upgrade a Ruby application from Stripe SDK v7.x to v15.x, moving from API version 2022-08-01 to 2025-03-31.basil.

    Available Problems

    1. charges-on-payment-intent: Update code that uses the deprecated payment_intent.charges attribute (removed in newer API versions). The solution must use Charge.list() or latest_charge instead.
    2. invoice-partial-payments: Update invoice-related code to work with SDK v15.x.
    3. subscription-billing-migration: Update subscription-related code to work with SDK v15.x.
  2. Overview of Stripe AI SDKs

    main

    Stripe AI provides a collection of SDKs designed to help you integrate Stripe's billing infrastructure with Large Language Models (LLMs) and agent frameworks.

    Key packages include:

    • @stripe/ai-sdk: Used for integrating Stripe's billing infrastructure with Vercel's ai and @ai-sdk libraries.
    • @stripe/token-meter: Used for integrating Stripe's billing infrastructure with native SDKs from OpenAI, Anthropic, and Google Gemini without framework dependencies.
  3. Overview of the Furever computer-use eval

    main

    Furever is a computer-use evaluation designed to test an AI's ability to integrate Stripe Connect Embedded Components into an existing Next.js application.

    The Task: The AI must add a Payments page to the provided Next.js application using the ConnectPayments component, configured with the following specific settings:

    • Disputes: Enabled
    • Refunds: Disabled
  4. Overview of FurEver: Stripe Connect embedded components demo

    main

    FurEver is a full-stack demo application for a vertical SaaS platform (pet salon management) that integrates Stripe Connect and Stripe Connect embedded components. It demonstrates how a platform can provide Stripe products and UIs directly within its own website to reduce engineering costs.

    The demo showcases a unified account configuration where:

    • Stripe owns loss liability
    • The platform owns pricing
    • Stripe is the onboarding owner
    • Connected accounts have no access to the Stripe dashboard

    Technical stack: Next.js, Express, React, TypeScript, Tailwind CSS, shadcn/ui, and Material UI.

  5. Overview of the Stripe Agent Toolkit

    main

    The Stripe Agent Toolkit enables integration between popular agent frameworks and Stripe APIs through function calling.

    Supported Frameworks:

    • Model Context Protocol (MCP)
    • OpenAI's Agent SDK
    • LangChain
    • CrewAI
    • Vercel's AI SDK

    Supported Languages:

    • Python
    • TypeScript

    The toolkit is built directly on top of the official Stripe Python and Node.js SDKs. Note that the toolkit does not support the entire Stripe API, but a subset of methods.

  6. Overview of SaaS Starter - Embedded Checkout Benchmark

    main

    This benchmark tests the ability of an AI agent to upgrade a Next.js SaaS application from hosted Stripe Checkout to embedded checkout. The evaluation involves three primary subtasks:

    1. Converting hosted checkout to embedded checkout: Migrating the implementation to use Stripe's embedded checkout.
    2. Promotion Code Management: Creating and applying a promotion code.
    3. Transaction Completion: Completing a test purchase and capturing the resulting checkout session ID.

    To pass, the solution must satisfy specific grading criteria: the UI mode must be embedded, the mode must be subscription, the payment status must be paid, and a promotion code TAKE20 (providing 20% off) must be applied.

  7. Provision services with Stripe Projects

    main

    Use Stripe Projects to provision third-party infrastructure such as databases, auth, hosting, analytics, caching, AI, and observability. You can also retrieve API keys and tokens for these services using the Stripe Projects CLI plugin.

    Triggers for this skill:

    • "I need a database"
    • "set up auth"
    • "provision Redis"
    • "add a vector DB"
    • "get credentials for X"
    • "show me the catalog"
    • Any mention of projects.dev or adding/provisioning/connecting cloud services.
  8. Understand the Galtee Invoicing evaluation focus

    main

    The Galtee Invoicing evaluation is designed to test an AI's ability to handle specific Stripe and data integration tasks. The core components provided are:

    • environment/PROBLEM.md: The problem prompt.
    • environment/server: A Node server skeleton.
    • environment/client: A static client.
    • environment/db: Database files.
    • grader: An RSpec grader containing hidden tests.

    Key evaluation areas:

    • Integrating with Stripe's Invoice API.
    • Migrating CSV data into SQLite and Stripe.
    • Creating Stripe Products and Invoices.
    • Implementing basic booking management APIs.
  9. Use the stripe-docs skill for Stripe documentation

    main
    The stripe-docs skill is designed for agents or users who need to read, search, or look up Stripe documentation or API references directly from the terminal. It is preferred over using curl or WebFetch for any docs.stripe.com content because it automatically fetches content in Markdown format and is optimized for agentic and terminal-based workflows.
  10. Understand the Stripe integration benchmarks structure

    main

    The Stripe integration benchmarks are agentic evaluations designed to test how AI agents handle Stripe integration tasks. The tasks are categorized into three types:

    1. Backend-only tasks: Focus on server-side integrations, including data migrations, database management, scripting, and updating backend APIs.
    2. Full stack tasks: Require both server-side and client-side integrations, where the agent is expected to use a browser to complete the task.
    3. Gym problem sets: Simulated exercises targeting specific Stripe features (like Checkout or Subscriptions) to test depth of understanding in niche scenarios.
  11. Decision Guide for Stripe Connect Charge Patterns

    main

    Use the following logic to determine which charge pattern to implement:

    1. Is there one seller per transaction?

      • No (multiple sellers) $\rightarrow$ Use SEPARATE CHARGES & TRANSFERS.
      • Yes $\rightarrow$ Proceed to step 2.
    2. Does the platform need to hold funds before releasing to the seller? (e.g., hold-and-release or delivery confirmation)

      • Yes $\rightarrow$ Use SEPARATE CHARGES & TRANSFERS.
      • No $\rightarrow$ Proceed to step 3.
    3. Is the seller the merchant of record?

      • Yes $\rightarrow$ Use DIRECT CHARGES.
      • No $\rightarrow$ Use DESTINATION CHARGES (Common marketplace default).

    Quick Rules Summary:

    • Marketplace (one seller, immediate payout): Destination charges
    • Marketplace (hold-and-release/delivery-gated): Separate charges and transfers
    • SaaS (seller owns relationship): Direct charges
    • Multi-seller cart/complex splits: Separate charges and transfers
  12. Implement partial payments for subscription invoices

    main

    The Partial Payments evaluation tests the ability to implement a split-payment flow for a single subscription invoice. A successful implementation involves:

    1. Subscription Configuration: Modify subscription creation to remove trial periods.
    2. Payment Behavior: Create the subscription using payment_behavior: 'default_incomplete'.
    3. Partial Payment Flow:
      • Create two separate checkout sessions, each for half of the total amount.
      • Use stripe.invoices.attach_payment to attach multiple payment intents to the single invoice.
    4. Completion: Complete both checkout flows and capture the resulting invoice ID.