Overview
The ouroborai API is a Hono-based REST server running on Arbitrum One. Routes are organized into groups with different authentication requirements:- Root — public, no authentication
- Agent — protected by x402 micropayments
- Swap, Automations, Launchpad, v1 Chat — require a
readwriteAPI key - Portfolio, Market, NFTs, Predictions, Bridge — require a
readonlyAPI key - Admin — require an
adminAPI key
Authentication
x402 Payment
Agent routes use the
X-PAYMENT header with a signed USDC micropayment. See the x402 payments guide for details.API Key
Other routes use the
Authorization: Bearer <api-key> header. Keys are tiered: readonly, readwrite, and admin. Higher tiers can access lower-tier routes.Root
Public endpoints for health checks and server metadata.GET /health
GET /health
Returns server health status.Authentication: NoneResponse:
GET /
GET /
Returns server metadata and version information.Authentication: NoneResponse:
Agent routes
All agent routes are protected by x402 micropayments ($0.01 USDC per request). The payer address is used as the owner ID for job and thread isolation.POST /agent/prompt
POST /agent/prompt
Submit a natural-language prompt to the AI agent. Returns a job ID for async polling and a thread ID for conversation continuity.Authentication: x402 paymentRequest body:
Response (202 Accepted):If no
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Natural-language instruction (max 4000 chars) |
threadId | string | No | Existing thread ID for multi-turn conversation |
context | object | No | Additional context passed to the agent runner |
threadId is provided, a new thread is created automatically.GET /agent/job/:id
GET /agent/job/:id
Poll for the status and result of an agent job.Authentication: x402 paymentResponse (running):Response (complete):Status values:
pending, running, complete, failed, cancelledDELETE /agent/job/:id
DELETE /agent/job/:id
Cancel a running agent job. Only jobs in
pending or running state can be cancelled.Authentication: x402 paymentResponse:GET /agent/thread/:id
GET /agent/thread/:id
Retrieve the full conversation history for a thread.Authentication: x402 paymentResponse:
GET /agent/skills
GET /agent/skills
List all available skills the agent can use.Authentication: x402 paymentResponse:
Swap routes
Swap routes provide direct access to DEX operations without going through the AI agent.GET /swap/quote
GET /swap/quote
Get a swap quote from Uniswap V3 or Camelot.Authentication:
Response:
readwrite API keyQuery parameters:| Param | Type | Required | Description |
|---|---|---|---|
tokenIn | string | Yes | Input token symbol (e.g., ETH, USDC, ARB) |
tokenOut | string | Yes | Output token symbol |
amountIn | string | Yes | Amount in raw units (wei for ETH, base units for tokens) |
dex | string | No | uniswap (default) or camelot |
POST /swap/execute
POST /swap/execute
Execute a token swap on Arbitrum.Authentication:
Response:
readwrite API keyRequest body:| Field | Type | Required | Description |
|---|---|---|---|
tokenIn | string | Yes | Input token symbol or address |
tokenOut | string | Yes | Output token symbol or address |
amountIn | string | Yes | Amount in raw units |
dex | string | No | uniswap (default) or camelot |
slippageBps | number | No | Slippage tolerance in basis points (default: 50 = 0.5%) |
Portfolio routes
Read-only access to job history and aggregated DeFi positions.GET /portfolio/jobs
GET /portfolio/jobs
List recent agent jobs. Results are scoped to the caller’s API key.Authentication:
Response:
readonly API keyQuery parameters:| Param | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Max results to return (capped at 100) |
GET /portfolio/positions
GET /portfolio/positions
Aggregated DeFi positions from Aave V3 and GMX V2.Authentication:
readonly API keyResponse:Market routes
Real-time market data from external price feeds.GET /market/prices
GET /market/prices
Token prices from CoinGecko for core Arbitrum assets (ETH, USDC, ARB, WBTC, PENDLE, GRAIL, LINK). Results are cached for 30 seconds.Authentication:
readonly API keyResponse:GET /market/trending
GET /market/trending
Trending pools on Arbitrum from GeckoTerminal. Returns the top 10 pools by activity. Results are cached for 30 seconds.Authentication:
readonly API keyResponse:Automations routes
Create and manage automated DeFi strategies.GET /automations
GET /automations
List automations for a wallet.Authentication:
Response:
readwrite API keyQuery parameters:| Param | Type | Required | Description |
|---|---|---|---|
wallet | string | Yes | Wallet address to filter by |
POST /automations
POST /automations
Create a new automation.Authentication: Response (201 Created):
readwrite API keyRequest body:PATCH /automations/:id
PATCH /automations/:id
Update an automation’s status (pause, resume, etc.).Authentication: Valid status values:
readwrite API keyRequest body:active, paused, completed, failedDELETE /automations/:id
DELETE /automations/:id
Delete an automation.Authentication:
readwrite API keyResponse:Admin routes
Operational endpoints for server administrators.GET /admin/revenue
GET /admin/revenue
Revenue summary across all x402 payments.Authentication:
admin API keyResponse:GET /admin/revenue/history
GET /admin/revenue/history
Daily revenue breakdown.Authentication:
Response:
admin API keyQuery parameters:| Param | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Number of days to include (max 90) |
Error responses
All endpoints return errors in a consistent format:| Code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — missing or invalid API key |
402 | Payment required — x402 payment needed or invalid |
403 | Forbidden — API key tier insufficient for this route |
404 | Not found — resource does not exist or belongs to another owner |
500 | Internal server error |
503 | Service unavailable — server wallet not configured |