Documentation

run.pay Documentation

๐Ÿ’ฐ Pricing: $0.005โ€“$0.10/call ยท 2% commission ยท No monthly fee See full pricing โ†’

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.

Base URL: https://runpay-backend-visibility-production.up.railway.app
RoleWhat you doTime to production
Agent developerCreate wallet โ†’ call services โ†’ agents pay autonomously~5 minutes
API providerRegister โ†’ publish endpoint โ†’ receive per-call payments~10 minutes

Quickstart โ€” Agent Developer

The fastest path from zero to a paid API call.

1

Install the SDK

bash
pip install runpay          # Python
npm install @runpay/sdk   # JavaScript
2

Create your agent wallet

Go to getrunpay.com/signup or use the API directly:

bash
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"}'
"agent_id": "agt_abc123def456",
"status": "active"

Save your agent_id โ€” this is your agent's identity across all services.

3

Call your first service

Python
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.

JSON body
{
  "agent_id": "agt_your_agent_id",
  ... your service payload
}
Trial mode: Use x-runpay-trial: your_trial_id header for the 3 free calls in the playground. Production calls require a funded wallet.

Create Agent Wallet

POST /api/agents/register
ParameterTypeDescription
emailrequired stringYour email address for notifications and billing
nameoptional stringYour name or organization
use_caseoptional stringHow you'll use run.pay (helps us improve)

Call a Service

POST /api/call/:service_id

Replace :service_id with the service UUID from the catalog.

ParameterTypeDescription
agent_idrequired stringYour agent wallet ID (agt_...)
...payloadrequired objectService-specific input (see each service's schema)
Example โ€” cURL
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

pip install runpay
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

npm install @runpay/sdk
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

Python
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

Python
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

Python
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

StatusError codeMeaning
400invalid_payloadMissing required field or wrong format
401invalid_agentAgent ID not found or inactive
402insufficient_balanceWallet balance too low โ€” add funds
429rate_limitedToo many requests โ€” retry with backoff
500service_errorService temporarily unavailable
Python โ€” error handling
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.

1

Register as a vendor

bash
curl -X POST .../api/vendors/register \
  -d '{"email": "you@company.com", "name": "My Service"}'

# Returns: {"vendor_key": "vnd_xxxxxxxxxx"}
2

Publish your service

JavaScript
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:

Incoming request to your endpoint
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
}
Verify the signature: Always verify X-Runpay-Signature to ensure the request comes from run.pay. Use your vendor secret key.

API Reference โ€” List Services

GET /api/services List all available services
Query paramTypeDescription
limitoptional numberMax results (default: 50, max: 205)
categoryoptional stringFilter by: AI, DATA, REASONING
searchoptional stringSearch by name or description

API Reference โ€” Call Service

POST /api/call/:service_id

The service ID is the UUID from GET /api/services.

Try any service for free in the interactive playground โ€” first 3 calls free, no credit card.

Services โ€” AI Safety

ServicePriceKey output
Hallucination Detector$0.01hallucination_score, risk_level
PII Scanner$0.01pii_found, findings[]
GDPR Compliance Checker$0.02gdpr_compliant, issues[]
AI Act Compliance$0.02risk_category, obligations[]
Bias Detector$0.02bias_score, biases[]
Sycophancy Detector$0.01sycophancy_score, signals[]
Logical Fallacy Detector$0.01fallacies[], count
Ethical Red Teamer$0.02attack_vectors[], severity

Services โ€” Data

ServicePriceKey output
Statistics Calculator$0.005mean, std, percentiles
Synthetic Data Generator$0.01records[], count
Monte Carlo Simulator$0.02mean, p95, histogram
CSV Validator$0.005valid, errors[]
Data Profiler$0.01quality_score, columns
Hypothesis Tester$0.005p_value, conclusion
Semantic Diff$0.01similarity, change_magnitude

Services โ€” Reasoning

ServicePriceKey output
Moral Reasoning Engine$0.02consensus, recommendation
Simulation Sandbox$0.01safe_to_execute, risk_score
Goal Decomposer$0.01subtasks[], critical_path
Argument Extractor$0.01pros[], cons[], balance
Chain of Thought Validator$0.005is_coherent, issues[]
Counterfactual Generator$0.01scenarios[], probability
Error Propagation Analyzer$0.01blast_radius, affected_steps
Ready to start?
Test any service free in the playground โ€” no credit card needed.
Open playground โ†’