How to Connect Stripe to an AI Agent
Auth setup
1. Sign up at dashboard.stripe.com. 2. Get API keys from Developers > API keys. 3. Use sk_test_ keys for development. 4. Switch to sk_live_ for production.
Key facts
| Base URL | https://api.stripe.com/v1/ |
| API version | v1 |
| Auth | API key as Bearer token. Secret key (sk_) for server-side, Publishable key (pk_) for client-side. Test mode keys start with sk_test_. |
| Request body | application/x-www-form-urlencoded |
| Pagination | cursor-based: use 'starting_after' param with last object ID. Default 10, max 100. |
| Rate limit | 100 req/sec (read), 25 req/sec (write) in test mode. Live: 100 read, 100 write. |
| Error format | JSON: {"error":{"type":"card_error","code":"card_declined","message":"..."}} |
Key endpoints
| Method | Path | Description |
POST | /charges | Create a charge |
POST | /payment_intents | Create payment intent (recommended) |
POST | /customers | Create customer |
GET | /invoices | List invoices |
POST | /subscriptions | Create subscription |
Quickstart
POST /v1/payment_intents
Authorization: Bearer sk_test_xxx
Content-Type: application/x-www-form-urlencoded
amount=2000¤cy=usd&payment_method_types[]=card
Agent pitfalls & tips
- IMPORTANT: Request body uses form-encoded, NOT JSON (despite JSON responses).
- Always use Payment Intents API over legacy Charges API.
- Test card numbers: 4242424242424242 (success), 4000000000000002 (decline).
- Amounts are in smallest currency unit: 2000 = $20.00 USD, 2000 = ¥2,000 JPY.
- Idempotency-Key header prevents duplicate charges on retries.
- Webhooks: verify signature with endpoint secret for security.
- [object Object]
Source: curated by KanseiLink from official documentation (docs) and registry checks. Last reviewed: 2026-06-08. Specs change — verify against the official docs before production use.
Frequently Asked Questions
What is Stripe's AEO score?
▼
Stripe has an AEO score of 0.90 and is rated AA (Strong agent support with minor gaps). AEO (Agent Engine Optimization) measures how well a SaaS service works with AI agents. Scores range from 0.00 to 1.00, with grades from AAA (best) to D (not agent-ready).
Is Stripe AI-agent-ready?
▼
Stripe is currently ✓ verified for AI agent use. It offers an official MCP (Model Context Protocol) server, which means AI agents can connect directly. For detailed connection guides, auth setup, and known pitfalls, use the KanseiLink MCP tool.
How does Stripe compare to other Payment services?
▼
In the Payment category, Stripe is rated AA. KanseiLink evaluates services based on MCP availability, API quality, documentation, auth-guide clarity, and integration recipe availability (methodology published). Visit the full rankings at kansei-link.com to see how Stripe compares.
How can I integrate Stripe with an AI agent?
▼
The fastest way to integrate Stripe with an AI agent is through KanseiLink MCP. Install it with: npx @kansei-link/mcp-server — then use the search_services and get_service_detail tools to get the current auth setup, endpoints, rate limits, and agent-specific tips. This data is kept fresh from registry checks, curated official-doc guides, and agent reports.
How do I authenticate with Stripe?
▼
API key as Bearer token. Secret key (sk_) for server-side, Publishable key (pk_) for client-side. Test mode keys start with sk_test_. Setup: 1. Sign up at dashboard.stripe.com. 2. Get API keys from Developers > API keys. 3. Use sk_test_ keys for development. 4. Switch to sk_live_ for production.
What are Stripe's API rate limits?
▼
100 req/sec (read), 25 req/sec (write) in test mode. Live: 100 read, 100 write.