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/sdk # 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/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "My Agent"}'"status": "active"
Save your agent_id โ this is your agent's identity across all services.
Call your first service
from runpay import RunPay client = RunPay(agent_id="agt_abc123def456") result = client.call("hallucination-detector", { "response": "According to Einstein, E=mcยฒ was published in 2003" }) print(result["hallucination_score"]) # 85 โ HIGH risk
"hallucination_score": 85,
"risk_level": "HIGH",
"signals": ["Incorrect date attribution"],
"_cost": "$0.01"
}
Authentication
All requests require an agent ID in the request body. No API key, no bearer token.
{
"agent_id": "agt_your_agent_id",
... your service payload
}x-runpay-trial: your_trial_id header for the 3 free calls in the playground. Production calls require a funded wallet.Create Agent Wallet
| 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) |
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 (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",
"response": "The Eiffel Tower was built in 1850 according to French records."
}'SDK Reference
Python
from runpay import RunPay client = RunPay( agent_id="agt_your_agent", timeout=30, # seconds (default: 30) retries=3 # automatic retries (default: 3) ) # Call any service by name or UUID result = client.call("hallucination-detector", payload) # List available services services = client.list_services(category="AI") # Check wallet balance balance = client.get_balance()
JavaScript
import RunPay from '@runpay/sdk' const client = new RunPay({ agentId: 'agt_your_agent', timeout: 30000, // ms retries: 3 }) const result = await client.call('hallucination-detector', payload) const services = await client.listServices({ category: 'AI' }) const balance = await client.getBalance()
Framework Guides
LangChain
from langchain.tools import tool from runpay import RunPay import os client = RunPay(agent_id=os.environ["RUNPAY_AGENT_ID"]) @tool def check_hallucination(response: str) -> dict: """Check if an LLM response contains hallucinations. Returns risk score 0-100.""" return client.call("hallucination-detector", {"response": response}) @tool def scan_pii(text: str) -> dict: """Detect PII (email, phone, SSN, etc.) in text before storing.""" return client.call("pii-scanner", {"text": text}) # Use in your agent tools = [check_hallucination, scan_pii]
CrewAI
from crewai.tools import BaseTool from runpay import RunPay client = RunPay(agent_id="agt_your_agent") class HallucinationDetector(BaseTool): name: str = "Hallucination Detector" description: str = "Check LLM outputs for hallucination risk" def _run(self, response: str) -> str: result = client.call("hallucination-detector", {"response": response}) return f"Risk score: {result['hallucination_score']}/100 ({result['risk_level']})"
AutoGen
import autogen from runpay import RunPay client = RunPay(agent_id="agt_your_agent") def check_hallucination(response: str) -> dict: """Check if an LLM response contains hallucinations.""" return client.call("hallucination-detector", {"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 |
from runpay import RunPay, RunPayError try: result = client.call("hallucination-detector", payload) except RunPayError as e: if e.code == "insufficient_balance": add_funds_to_wallet() elif e.code == "rate_limited": time.sleep(e.retry_after) else: raise
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_key": "vnd_xxxxxxxxxx"}Publish your service
import { RunPay } from 'runpay' const rp = new RunPay({ apiKey: 'vnd_your_key' }) await rp.publish({ name: 'My Web Scraper', description: 'Scrape any URL, returns clean markdown', price_per_call: 0.05, endpoint: 'https://api.yoursite.com/scrape', category: 'DATA', input_schema: { url: { type: 'string', required: true, description: 'URL to scrape' } } })
Webhook Format
When an agent calls your service, run.pay forwards the request to your endpoint with this format:
POST https://api.yoursite.com/your-endpoint
Content-Type: application/json
X-Runpay-Signature: sha256=...
X-Runpay-Call-Id: call_abc123
{
"agent_id": "agt_caller_agent",
"call_id": "call_abc123",
"payload": { ...agent's input... },
"timestamp": 1735689600
}X-Runpay-Signature to ensure the request comes from run.pay. Use your vendor secret key.API Reference โ List Services
| Query param | Type | Description |
|---|---|---|
| limit | optional number | Max results (default: 50, max: 205) |
| category | optional string | Filter by: AI, DATA, REASONING |
| search | optional string | Search by name or description |
API Reference โ Call Service
The service ID is the UUID from GET /api/services.
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, 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, affected_steps |