コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
Ask AI
アカウントを作成
サインイン
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
始める
支払い
財務の自動化
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
概要
バージョン管理
変更ログ
API バージョンのアップグレード
SDK バージョンをアップグレードする
開発者向けのツール
SDK
API
テスト
ワークベンチ
イベントの送信先
ワークフロー
Stripe CLI
Stripe Shell
開発者ダッシュボード
エージェントツールキット
    概要
    クイックスタート
Stripe health alertsLLM を使用した構築Visual Studio Code をご利用の場合ファイルのアップロード
セキュリティ
セキュリティ
Stripe を拡張する
Stripe Apps
Stripe のコネクター
パートナー
Partner Ecosystem
パートナー認定
ホーム開発者向けのツールAgent toolkit

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

エージェントワークフローに Stripe を追加する開発者プレビュー

エージェントで金融サービスを使用します。

Stripe を利用してエージェントビジネスを運営し、エージェントの機能を強化します。金融サービスとツールへのアクセスを提供すると、エージェントは資金の獲得と利用をサポートできるようになり、その機能を拡張できます。

Stripe オブジェクトを作成する

関数呼び出しを使用して一般的な決済フローを自動化します。

エージェントの使用量に対して請求する

Bill users with usage-based billing and charge for calls to MCP servers.

オンラインで商品を購入する

1 回限り使用できるバーチャルカードを使用して商品を購入します。

Stripe オブジェクトを作成する

関数呼び出しを使用して Stripe オブジェクトを作成し、管理します。たとえば、資金を受け取るための Payment Links を動的に作成し、顧客をサポートするためのサポートワークフローに導入し、テストデータを作成します。

Stripe のエージェントツールキットは、OpenAI の Agents SDK、Vercel の AI SDK、LangChain、CrewAI をサポートしています。関数呼び出しをサポートし、Python および TypeScript と互換性のある任意の LLM プロバイダーで動作します。

Python
import asyncio import os from agents import Agent, Runner from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit stripe_agent_toolkit = StripeAgentToolkit( secret_key=os.getenv("STRIPE_SECRET_KEY"), configuration={ "actions": { "payment_links": { "create": True, }, "products": { "create": True, }, "prices": { "create": True, }, } }, ) agent = Agent( name="Stripe Agent", instructions="Integrate with Stripe effectively to support business needs.", tools=stripe_agent_toolkit.get_tools() ) async def main(): assignment = "Create a payment link for a new product called \"Test\" with a price of $100." result = await Runner.run(agent, assignment) print(result.final_output) if __name__ == "__main__": asyncio.run(main())

開発者プレビュー

この SDK を使用して、Stripe とエージェントワークフローを連携させる方法をご紹介します。エージェントの動作は非決定論的であるため、一度サンドボックスで SDK を使用し、アプリケーションのパフォーマンスを評価します。さらに、制限付き API キーを使用して、エージェントが必要とする機能へのアクセスを制限します。

代理人使用料を請求する

Agents SDKs

従量課金を実装して、使用量を記録します。Stripe のエージェントツールキットは、OpenAI Agents SDK と Vercel AI SDK でのプロンプトと完了トークンによる請求をネイティブでサポートしています。入出力メーターイベントの Customer と event_name を使用して、LLM のコストをユーザーに直接転送できます。

from agents import Agent, Runner from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit stripe_agent_toolkit = StripeAgentToolkit( secret_key=os.getenv("STRIPE_SECRET_KEY"), configuration={} ) agent = Agent( name="Agent", instructions="Integrate with Stripe effectively to support business needs.", hooks=stripe_agent_toolkit.billing_hook( type="token", customer=os.getenv("STRIPE_CUSTOMER_ID"), meters={ "input": os.getenv("STRIPE_METER_INPUT"), "output": os.getenv("STRIPE_METER_OUTPUT"), }, ), )

Model Context Protocol servers Public preview

Model Context Protocol (MCP) is an open protocol to standardize how applications provide context to LLMs. The Stripe Agent toolkit offers wrapper functions to monetize your tool calls to MCP servers hosted on Cloudflare’s Agent SDK.

サンプル全体を表示
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { McpAgent } from "agents/mcp"; import { generateImage } from "./imageGenerator"; import { OAuthProvider } from "@cloudflare/workers-oauth-provider"; import { PaymentState, experimental_PaidMcpAgent as PaidMcpAgent, } from '@stripe/agent-toolkit/cloudflare'; import app from "./app"; type Bindings = Env; type Props = { // Populate this via OAuth userEmail: string; }; type State = {}; export class MyMCP extends PaidMcpAgent<Bindings, State, Props> { server = new McpServer({ name: "Demo", version: "1.0.0", }); initialState: State = {}; async init() { this.paidTool( "generate_emoji", { object: z.string().describe("one word") }, ({ object }) => { return { content: [{ type: "text", text: generateImage(object) }], }; }, { priceId:
'{{PRICE_ID}}'
, successUrl: '{{SUCCESS_URL}}', paymentReason: 'Emoji generation costs 10 cents per emoji', } ); } } export default new OAuthProvider({ apiRoute: "/sse", apiHandler: MyMCP.mount("/sse"), defaultHandler: app, authorizeEndpoint: "/authorize", tokenEndpoint: "/token", clientRegistrationEndpoint: "/register", });

To search Stripe documentation and query your Stripe data, use the Stripe MCP server.

オンラインで商品を購入する

  • Issuing: Create single-use virtual cards for your business purchases. This allows your agents to spend funds. The Issuing APIs allow you to programmatically approve or decline authorizations, ensuring your purchase intent matches the authorization. Spending controls allow you to set budgets and limit spending for your agents.
  • Order Intents プライベートベータ版: Give your agents commerce capabilities through programmatic execution of purchases online. This agentic API helps facilitate variant and fulfillment selections and manage the order lifecycle. To join the private preview, fill out the form below.

次のステップ

  • 詳細なコード例については、エージェントのクイックスタートをご覧ください。
  • GitHub のエージェントツールキットをダウンロード
  • ガイドに従って、Issuing での B2BPayment の導入を構築します
このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc