Skip to Content
🚀 {xpay✦} is building the future of x402 payments - Join the developer beta →
xpay✦ HubAPI ReferenceOverview

API Reference

xpay✦ Hub provides a REST API for running RDAs and managing your account.

Base URL

https://api.xpay.sh/hub

Authentication

All authenticated endpoints require a Bearer token:

Authorization: Bearer YOUR_TOKEN

Tokens are obtained through Privy authentication.

Endpoints Overview

RDA Execution

MethodEndpointDescription
POST/runExecute an RDA

RDA Catalog

MethodEndpointDescription
GET/rdasList all RDAs
GET/rda/{slug}Get RDA details
POST/rdaCreate an RDA

Wallet

MethodEndpointDescription
GET/wallet/balanceCheck balance
POST/wallet/depositRecord deposit

Response Format

All responses follow this structure:

Success

{ "data": { ... }, "metadata": { "timestamp": "2024-01-01T00:00:00Z" } }

Error

{ "error": "Error message", "code": "ERROR_CODE", "details": { ... } }

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad request
401Unauthorized
402Payment required
403Forbidden
404Not found
500Server error

Rate Limits

  • Authenticated: 100 requests/minute
  • Unauthenticated: 10 requests/minute

Rate limit headers:

X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1704067200

SDKs

JavaScript/TypeScript

npm install @xpaysh/hub-sdk
import { XpayHub } from '@xpaysh/hub-sdk' const client = new XpayHub({ apiKey: 'YOUR_API_KEY' }) const result = await client.run('research-report-generator', { topic: 'SaaS Pricing', depth: 'comprehensive' })

Python

Coming soon.

Webhooks

For long-running operations, configure webhook callbacks:

{ "webhookUrl": "https://your-server.com/callback", "webhookEvents": ["run.completed", "run.failed"] }

Getting Help

Last updated on: