run.pay Documentation
run.pay is a Stripe-native API marketplace for autonomous AI agents. Agents discover and call 205 specialized services in a single HTTP request — no account creation, no API key provisioning, no subscriptions. Stripe handles billing autonomously.
https://runpay-backend-visibility-production.up.railway.app| Role | What you do | Time to production |
|---|---|---|
| Agent developer | Create wallet → call services → agents pay autonomously | ~5 minutes |
| API provider | Register → publish endpoint → receive per-call payments | ~10 minutes |
Quickstart — Agent Developer
The fastest path from zero to a paid API call.
Install the SDK
pip install runpay # Python npm install runpay # JavaScript
Create your agent wallet
Go to getrunpay.com/signup or use the API directly:
curl -X POST https://runpay-backend-visibility-production.up.railway.app/api/agents/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "My Agent"}'Save your agent_id — this is your agent's identity across all services. A welcome email also arrives with a private link to manage your wallet.
Call your first service
import runpay runpay.configure(agent_id="agt_abc123def456") result = runpay.call("halludetect", { "response": "According to Einstein, E=mc² was published in 2003" }) print(result["hallucination_score"]) # 0-100
"success": true,
"hallucination_score": 72,
"risk_level": "HIGH",
"signals": ["..."],
"recommendation": "...",
"_meta": { "cost": 0.01, "balance_after": 4.99 }
}
Authentication
The SDK sends your agent ID as a header automatically (runpay.configure() handles this). If you're calling the API directly instead of using the SDK, the exact mechanism depends on the endpoint:
X-RunPay-Agent: agt_your_agent_id
{ "agent_id": "agt_your_agent_id", "payload": { ... } }x-runpay-trial: your_trial_id header for the 3 free calls in the playground. Production calls require a funded wallet.Base URL
All API requests go to:
https://runpay-backend-visibility-production.up.railway.app
No versioning prefix yet — all endpoints shown in this documentation are relative to this base URL.
Create Agent Wallet
Two ways to get a wallet, depending on whether a human is involved in the setup:
| Parameter | Type | Description |
|---|---|---|
| required string | Your email address for notifications and billing | |
| name | optional string | Your name or organization |
| use_case | optional string | How you'll use run.pay (helps us improve) |
An agent generates its own agent_id and registers it directly — no email, no human step. Useful for agent-to-agent commerce where nobody's watching.
| Parameter | Type | Description |
|---|---|---|
| agent_id | required string | Any unused agt_... string the agent generates itself |
"agent_id": "agt_yourownrandomid123",
"wallet_id": "...",
"wallet_secret": "wsec_...",
"client_secret": "seti_..._secret_..."
}
wallet_secret is shown only this once — store it. Trial calls (3 per service) work immediately, no funding needed. Attaching real money to the wallet still needs a human to enter a card via Stripe at some point — no payment system can skip that step entirely.Call a Service
Replace :service_id with the service UUID from the catalog.
| Parameter | Type | Description |
|---|---|---|
| agent_id | required string | Your agent wallet ID (agt_...) |
| payload | required object | Service-specific input, nested under this key (see each service's schema) |
curl -X POST https://runpay-backend-visibility-production.up.railway.app/api/call/14783c94-915e-4054-83eb-af6b22c542c3 \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_your_agent",
"payload": {
"response": "The Eiffel Tower was built in 1850 according to French records."
}
}'Workflows
A vendor can publish a multi-step pipeline as one purchasable unit — call the whole chain in a single request. Billed step-by-step: if a step fails partway through, you're only ever charged for the steps that genuinely succeeded, never the ones that didn't run.
Browse published, active workflows.
Real step-by-step breakdown and an estimated total price, before you run it.
| Parameter | Type | Description |
|---|---|---|
| agent_id | required string | Your agent wallet ID (agt_...) |
| input | required object | Input for the workflow's first step |
Send an Idempotency-Key header (any unique string you generate per attempt) — a genuinely retried request after a dropped connection reuses the same result instead of re-running, and re-charging for, steps that already succeeded.
curl -X POST https://runpay-backend-visibility-production.up.railway.app/api/workflows/{workflow-id}/execute \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wf-exec-a1b2c3" \
-d '{
"agent_id": "agt_your_agent",
"input": {
"text": "The document to process"
}
}'Leaderboard
Real, verified rankings — every badge requires a genuine minimum sample size and diverse usage across distinct agents. None can be earned from a single call or a handful of self-generated ones.
Top APIs, top AI services, and top vendors — each with Verified, Fast, Trending, Premium, and Enterprise Ready badges where genuinely earned.
External Discovery
run.pay aggregates three independent x402 ecosystems alongside its own catalog — the Coinbase x402 Bazaar, Circle's Agent Marketplace, and agent402.tools. Search once, see everything.
{ "query": "weather forecast", "max_price_usd": 0.05 }
Returns runpay_results (payable directly, payable_via_runpay: true) and external_results — each tagged with its real source (x402_bazaar_external, circle_marketplace_external, or agent402_tools_external). Ecosystem status reported independently via coinbase_status, circle_status, agent402_status — one being down never affects the others.
Each external result includes a runpay_bridge_attempt field:
{ "available": true, "endpoint": "/api/call-external", "note": "..." }
This is an honest, experimental invitation, not a guarantee. run.pay can attempt to pay the external service with its own crypto wallet and bill you in USD via /api/call-external — verified to work end-to-end against lenient verifiers, but known to fail against some strict production verifiers for reasons not yet fully resolved. External results are never pre-certified as "payable" — that would require testing every provider with real funds, which we don't do speculatively.
Native Crypto Payment (x402)
run.pay accepts native crypto payment (USDC on Base) directly, alongside Stripe — no account, no API key, no wallet setup on our side needed by the buyer. Standard x402 protocol, scheme exact, verified and settled by run.pay itself, no third-party facilitator dependency. Confirmed working end-to-end with real, verifiable on-chain settlement across multiple services.
Call without a PAYMENT-SIGNATURE header to receive a real 402 challenge (also mirrored in the PAYMENT-REQUIRED response header, base64-encoded):
{ "x402Version": 2, "accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "...", "asset": "0x8335...", "payTo": "0x...", "maxTimeoutSeconds": 300, "extra": { "name": "USD Coin", "version": "2" } }] }
Sign an EIP-3009 transferWithAuthorization for the exact amount, then retry the same request with PAYMENT-SIGNATURE: <base64(payload)>. The vendor is called and must succeed before any real settlement is submitted on-chain — if the vendor call fails, you are never charged.
service_id works for any active service in the catalog — find it via x402_crypto_endpoint on /api/services.
Machine Payments Protocol (MPP)
Stripe and Tempo's open standard for agent payments — a real, third native payment path alongside Stripe checkout and x402 crypto. Runs entirely on run.pay's existing Stripe infrastructure; no new dependency. Minimum $0.50 per charge — a real card network rule, not a run.pay restriction.
Call without a PAYMENT-CREDENTIAL header to receive a real 402 challenge (RFC 9457 Problem Details format, with a WWW-Authenticate: Payment header). Obtain a Shared Payment Granted Token (spt_...) from your own payment provider, scoped to at least the requested amount, then retry with PAYMENT-CREDENTIAL: spt_....
Services priced below $0.50 are not available via MPP — a real card network minimum, not something run.pay can waive.
UCP Discoverability
run.pay publishes a standard Universal Commerce Protocol manifest so UCP-aware agents can discover it without hard-coded integration.
Returns run.pay's real service and payment-handler manifest. Honestly scoped: run.pay sells directly-payable API calls, not shopping carts — the manifest reflects that rather than forcing generic e-commerce semantics. Declares both real payment handlers already live: x402 and mpp.
Agent Economic Layer
acknowledge_risk: true field to use.
Beyond calling services, agents can transact directly with each other. All routes are POST to /internal/{name} with an X-RunPay-Agent header and an action field selecting the operation.
| Route | Purpose |
|---|---|
/internal/loan | Peer-to-peer collateralized lending with real interest — action=request then action=fund |
/internal/stake | Financially-backed sponsorship, slashed on the protégé's verified default |
/internal/syndicate | Shared wallets with M-of-N approval thresholds for spending |
/internal/contracttransfer | Transfer an active contract obligation to a new agent |
/internal/truthmarket | Stake real money behind a real-world claim, challengeable, resolved by peer jury |
/internal/insurance | Individually-underwritten policies between agents — action=offer then action=buy |
/internal/revenueshare | Sell a capped percentage of future earnings for upfront capital |
/internal/capacityfutures | Lock in future task capacity at a fixed price |
/internal/disputejury | Peer-jury resolution for rejected transaction disputes |
Spending Mandates (AP2-inspired)
A real human can cryptographically pre-authorize what an agent may spend, before any call happens — reusing the same EIP-712 signature infrastructure as native crypto payment.
Requires the agent's real wallet_secret to prove genuine ownership before a mandate can be created for it. Body: { agent_id, signer_address, max_amount_per_call, max_total_amount, allowed_service_id, allowed_category, min_vendor_score, expires_at, signature, nonce, wallet_secret }. allowed_category and min_vendor_score are genuinely part of the cryptographically signed payload — never falsifiable metadata added after the fact. Checked automatically before every call this agent makes, until it expires, is revoked, or its total is exhausted.
Guard (Risk Engine)
A real, unified decision engine — combines trust score, active mandate limits, and the human approval threshold into one coherent verdict. Read-only: it never commits a spend itself, real enforcement still happens at actual payment time.
Body: { agent_id, amount_usd, vendor_id, service_id }. Returns { verdict: "green"|"yellow"|"red", trust_score, reasons[] }. A non-existent agent genuinely returns red; a registered agent with no history yet returns yellow — never silently treated as fully trusted.
Intent Firewall
Distinct from Guard: Guard asks "can this agent spend this amount?" — Intent Firewall asks "is this actually what the agent said it was going to do?" A real, direct mitigation against prompt-injection and context-manipulation risks in agentic payment flows.
Body: { agent_id, description, expected_category, max_expected_amount, ttl_seconds }. Returns a short-lived intent_id (default 5 min, max 1h).
Body: { service_id, amount_usd }. Returns { matches: true|false, reason } — checks category match exactly, and amount within a real 10% tolerance of what was declared.
Multi-Rail Router
Recommends the real best payment rail among those actually built and working — x402 crypto, MPP, Stripe, and now XRPL.
Body: { amount_usd, prefers_crypto }. Returns recommended_rail plus every rail's real availability — e.g. MPP is honestly marked unavailable below its real $0.50 card-network minimum. This is routing guidance only, it never executes a payment itself.
Agent Passport
A real aggregation, never a new source of truth — pulls identity verification, wallet status, reputation, active mandate, and recent activity into one unified view.
Also see GET /api/agents/:agent_id/score-explained for a real, honest breakdown of exactly how the trust score was reached — real point values, never an opaque number.
Accounting
Real spending broken down by service category — reuses the existing hierarchical wallet system for a genuine fleet-wide view when an agent has children.
Returns totals and a real per-category breakdown. Not a legal invoice — no VAT/tax jurisdiction handling. A formatted single-transaction receipt is also available at GET /api/agents/:agent_id/accounting/receipt/:transaction_id.
Treasury
A real enrichment of the hierarchical wallet system — group child agents into departments for cost-center-style aggregation.
Pass an optional treasury_department when creating a child via POST /api/agents/children. Returns allocated-remaining and spent totals grouped by department.
Financial Dashboard
A real fleet-wide summary — total agents, balance, today's spend, transaction count, failure rate, pending approvals.
risk_alerts is honestly a live count of currently low-trust agents in the fleet — run.pay does not store a historical log of past Guard verdicts, so this is never a count of past incidents.
Observability
Connects the Intent Firewall to the real transaction it resulted in — a complete, real audit chain: declared intent → vendor selected → price → payment status.
Body: { transaction_id }. Then view the full real chain at GET /api/observability/:transaction_id.
Economic Chains
A real, hash-chained ledger for multi-hop agent-to-agent workflows — genuinely a ledger, never an auto-executing orchestrator. Each agent reports its own real payment, already made separately through the normal payment routes.
| Route | Purpose |
|---|---|
POST /api/chains/create | Start a new chain |
POST /api/chains/:id/hop | Report a real hop that already happened |
GET /api/chains/:id | View the full hash-chained history and totals |
Smart Ranking
An honestly-documented composite ranking — never an opaque score. Add sort=smart to /api/services/catalog.
smart_score.Kill Switch
X-Admin-Key header.A real, three-level emergency freeze — platform-wide, per-agent, or per-vendor — checked before every real payment across x402, native crypto, MPP, and XRPL.
| Route | Purpose |
|---|---|
POST /api/admin/kill-switch/freeze-all | Blocks every payment on the platform, immediately |
POST /api/admin/kill-switch/freeze-agent/:agent_id | Blocks a specific agent |
POST /api/admin/kill-switch/freeze-vendor/:vendor_id | Blocks a specific vendor |
GET /api/admin/kill-switch/status | Real current freeze status at every level |
SDK Reference
Python
import runpay runpay.configure(agent_id="agt_your_agent") # Call any service by ID result = runpay.call("halludetect", {"response": "..."}) # List available services services = runpay.services(category="AI") # Check wallet balance balance = runpay.wallet()
JavaScript
const { configure, call, services, wallet } = require('runpay') // or: import { configure, call, services, wallet } from 'runpay' configure('agt_your_agent') // Call any service by ID const result = await call('halludetect', { response: '...' }) // List available services const allServices = await services('AI') // Check wallet balance const balance = await wallet()
Framework Guides
LangChain
Generate all 205 services as ready-to-use LangChain tools in one line — no manual wrapping needed:
from runpay.langchain import get_tools tools = get_tools(agent_id="agt_your_agent") # all your available services tools = get_tools(agent_id="agt_your_agent", category="Security") # just one category from langchain.agents import initialize_agent agent = initialize_agent(tools, llm, agent="zero-shot-react-description")
CrewAI
Same idea — generated automatically from the live catalog:
from runpay.crewai import get_tools tools = get_tools(agent_id="agt_your_agent") from crewai import Agent researcher = Agent(role="Researcher", goal="...", tools=tools)
AutoGen
No dedicated integration yet — wrap the function you need directly:
import autogen import runpay runpay.configure(agent_id="agt_your_agent") def check_hallucination(response: str) -> dict: """Check if an LLM response contains hallucinations.""" return runpay.call("halludetect", {"response": response}) assistant = autogen.AssistantAgent( name="assistant", llm_config={ "functions": [{ "name": "check_hallucination", "description": "Check LLM output for hallucination risk", "parameters": {"type": "object", "properties": {"response": {"type": "string"}}} }] } ) autogen.register_function(check_hallucination, caller=assistant)
Error Handling
| Status | Error code | Meaning |
|---|---|---|
| 400 | invalid_payload | Missing required field or wrong format |
| 401 | invalid_agent | Agent ID not found or inactive |
| 402 | insufficient_balance | Wallet balance too low — add funds |
| 429 | rate_limited | Too many requests — retry with backoff |
| 500 | service_error | Service temporarily unavailable |
import runpay from runpay import RunpayError, InsufficientBalanceError try: result = runpay.call("halludetect", payload) except InsufficientBalanceError as e: print(f"Need ${e.required}, have ${e.balance}") add_funds_to_wallet() except RunpayError as e: print(f"Call failed: {e}")
Publishing a Service (Providers)
Publish your API on run.pay and every AI agent developer becomes a potential customer. You keep 98% of every call.
Register as a vendor
curl -X POST .../api/vendors/register \
-d '{"email": "you@company.com", "name": "My Service"}'
# Returns: {"vendor_id": "...", "api_key": "vnd_xxxxxxxxxx", "stripe_onboarding_url": "..."}Publish your service
There's no SDK method for this yet — publish directly via the API, or from your vendor dashboard:
curl -X POST .../api/services \
-H "x-api-key: vnd_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Web Scraper",
"description": "Scrape any URL, returns clean markdown",
"price_per_call": 0.05,
"endpoint_url": "https://api.yoursite.com/scrape",
"category": "DATA",
"schema_input": {
"url": "URL to scrape"
}
}'Pricing Guide
You set your own price per call — run.pay takes a flat 2% commission, no subscription, no listing fee. Payouts go to your connected Stripe account.
| Model | What happens |
|---|---|
You set price_per_call | Any amount from $0.001 to $1000, whatever your service is worth |
| Agent pays | Full price_per_call, charged automatically per call |
| You receive | 98% of each call, added to your Stripe balance |
| Payouts | Automatic every 7 days, or request one manually from your vendor dashboard |
Analytics
Your vendor dashboard shows live revenue, calls per service, error rates, and a breakdown by agent — no separate analytics API needed for normal use. If you're building your own reporting, the same data is available at GET /api/vendors/stats and GET /api/vendors/analytics (both require your x-api-key header).
Webhook Format
When an agent calls your service, run.pay forwards the agent's payload directly to your endpoint — no wrapper object, just the raw payload the agent sent:
POST https://api.yoursite.com/your-endpoint
Content-Type: application/json
X-RunPay-Call-Id: 1735689600.a1b2c3d4e5f6...
X-RunPay-Agent: agt_caller_agent
X-RunPay-Protocol: x402
X-RunPay-Signature: sha256=...
{ ...agent's raw input, exactly as they sent it... }const crypto = require('crypto');
const expected = 'sha256=' + crypto.createHmac('sha256', SIGNING_SECRET)
.update(rawRequestBody).digest('hex');
if (expected !== req.headers['x-runpay-signature']) {
return res.status(401).json({ error: 'Invalid signature' });
}X-RunPay-Agent header, not in the request body — your endpoint receives only the payload fields your service expects (e.g. {"text": "..."}), not a wrapper object.API Reference — List Services
| Query param | Type | Description |
|---|---|---|
| limit | optional number | Max results (default: 50, max: 200) |
| category | optional string | Filter by: AI, DATA, MEDIA |
| search | optional string | Search by name or description |
API Reference — Call Service
The service ID is the UUID from GET /api/services. Your agent's card on file is charged directly for this specific call.
POST https://runpay-backend-visibility-production.up.railway.app/api/call/<service_id>
Content-Type: application/json
{
"agent_id": "agt_your_agent_id",
"payload": { ...whatever this specific service expects... }
}runpay.call()), which talks to the newer /x402/:serviceId endpoint and handles wallet balance + auto top-up automatically. This endpoint charges your card directly per call — useful if you're not using the SDK.API Reference — Wallet
"agent_id": "agt_abc123xyz",
"balance": 4.99,
"total_spent": 0.12,
"mode": "production"
}
API Reference — Vendors
See the Publishing a Service section above for the full signup + publish flow.
Requires your x-api-key header. Powers the vendor dashboard Overview tab — same data.
Requires your x-api-key header. Every field is optional — send only what you're changing. Real fields: active (bool), price_per_call (0.005–0.10), name, min_agent_score (0–1000 or null), high_trust_threshold / high_trust_discount_pct, trust_discount_tiers, allow_vouching.
Schema declaration: schema_input and schema_output — a real JSON Schema object for each (must include at least a type field, or the update is rejected). Most services currently have no declared schema at all — this is genuinely optional, but declaring one lets agents and integration partners validate a request before sending it, instead of guessing from examples.
{
"schema_input": { "type": "object", "properties": { "phone": {"type": "string"} }, "required": ["phone"] },
"schema_output": { "type": "object", "properties": { "is_valid": {"type": "boolean"} } }
}
Enterprise — Getting Started
Organizations centralize spend, identity, and control across every agent a company runs. An organization is owned by a verified vendor account — creating one doesn't require completing Stripe payout onboarding, just a vendor account with an API key.
| Field | Type | Description |
|---|---|---|
| name | string | Organization display name |
access_key — this is how agents authenticate to see and call the organization's private catalog. It cannot be recovered later; if lost, rotate it (see Ownership & deletion).Members & Roles
Four roles, in order: viewer (read-only) < member (use the catalog and wallet) < admin (manage services, wallet, members) < owner (the vendor who created the organization — full control, including billing and deletion).
| Field | Type | Description |
|---|---|---|
| string | Invitee's email | |
| role | string | viewer, member, or admin |
Returns a one-time invite_token. Send it to the invitee directly — it's used at POST /api/organizations/members/accept to activate their membership and generate their own personal token.
Body: { "invite_token": "inv_..." }. Returns a personal personal_token, shown once — this authenticates the member for every role-gated action, sent as an X-Member-Token header instead of the owner's X-Api-Key.
Shared Wallet & Spending Limits
One real shared balance, distinct from individual agent wallets. An agent explicitly linked to the organization draws exclusively from this pool for every call — never its own wallet, as long as it stays linked.
| Field | Type | Description |
|---|---|---|
| agent_id | string | The agent to link |
| daily_limit_usd | optional number | Per-agent daily cap within the shared pool — omit for no limit |
Body: { "amount_usd": 500 }. Manual crediting for now — no self-service card charge flow exists yet specifically for wallet top-ups (distinct from the $1,999/month subscription itself, which does have real Stripe checkout).
Query param days (default 30, max 90). Returns per-agent totals and a daily trend, for agents linked to this organization's wallet.
Private Marketplace
Publish internal APIs visible only to your own agents, plus an explicit allowlist of public services — never implicit access to the full public catalog.
Same validation as a public service — HTTPS required, price between $0.005–$0.10. It never appears in the public catalog, ranking, or discovery.
Body: { "task_types": ["ocr", "translation"] }. Opt-in only — an empty array (the default) means no restriction. Once set, agents linked to this organization's wallet can only call services of these types.
SSO (OIDC)
| Field | Type | Description |
|---|---|---|
| issuer_url | string | Your IdP's OIDC issuer (HTTPS only) |
| client_id / client_secret | string | From your IdP |
| redirect_uri | string | Where the IdP sends the browser back |
| default_role | string | Role assigned on first SSO sign-in |
Sign-in URL: GET /api/organizations/:orgId/sso/login. Uses PKCE (RFC 9700) and real RS256 signature verification against your IdP's JWKS — no third-party JWT library, only Node's built-in crypto.
SLA & Audit Log
Measured from real health checks recorded every 5 minutes — never backfilled. If tracking began partway through the requested period, the response says so explicitly rather than treating missing history as compliant.
Membership changes, service publishing, wallet activity, config changes — each entry records whether the owner or a specific member (and their role) performed it.
Ownership & Deletion
The old key stops working immediately. Every agent using it needs the new one.
Body: { "new_owner_email": "..." }. The recipient must already have a vendor account. The current owner's owner-level access ends immediately.
Body: { "confirm_name": "..." } — must exactly match the organization's name. Refused if the wallet balance isn't zero. Private services are deactivated, never deleted, to preserve past transaction history.
Services — AI Safety
| Service | Price | Key output |
|---|---|---|
| Hallucination Detector | $0.01 | hallucination_score, risk_level |
| PII Scanner | $0.01 | pii_found, findings[] |
| GDPR Compliance Checker | $0.02 | gdpr_compliant, issues[] |
| AI Act Compliance | $0.02 | risk_category, obligations[] |
| Bias Detector | $0.02 | bias_score, biases[] |
| Sycophancy Detector | $0.01 | sycophancy_score, signals[] |
| Logical Fallacy Detector | $0.01 | fallacies[], count |
| Ethical Red Teamer | $0.02 | attack_vectors[], severity |
Services — Data
| Service | Price | Key output |
|---|---|---|
| Statistics Calculator | $0.005 | mean, std, percentiles |
| Synthetic Data Generator | $0.01 | records[], count |
| Monte Carlo Simulator | $0.02 | mean, percentiles.p95, histogram |
| CSV Validator | $0.005 | valid, errors[] |
| Data Profiler | $0.01 | quality_score, columns |
| Hypothesis Tester | $0.005 | p_value, conclusion |
| Semantic Diff | $0.01 | similarity, change_magnitude |
Services — Reasoning
| Service | Price | Key output |
|---|---|---|
| Moral Reasoning Engine | $0.02 | consensus, recommendation |
| Simulation Sandbox | $0.01 | safe_to_execute, risk_score |
| Goal Decomposer | $0.01 | subtasks[], critical_path |
| Argument Extractor | $0.01 | pros[], cons[], balance |
| Chain of Thought Validator | $0.005 | is_coherent, issues[] |
| Counterfactual Generator | $0.01 | scenarios[], probability |
| Error Propagation Analyzer | $0.01 | blast_radius, impacted_steps_detail[] |