03
Developers
- openai‑compatible
- api.tryparable.ai/v1
- usdg settlement
Point any OpenAI SDK at the gateway and ask for a route instead of a model. You get routing, fallbacks, metering, on‑chain tools and USDG settlement without changing your code.
01 · Quickstart
BASE URL https://api.tryparable.ai/v1
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.tryparable.ai/v1", apiKey: process.env.PARABLE_API_KEY });
const res = await client.chat.completions.create({
model: "parable/auto",
messages: [{ role: "user", content: "Summarize this 10-K in five bullets." }],
// @ts-expect-error Parable extension
parable: { prefer: "cost", max_cost_usd: 0.01, fallback: true },
});
console.log(res.model); // the model that actually served the request02 · Routes
| parable/auto | Balanced cost, speed and quality. Short prompts lean fast. |
| parable/fast | Lowest latency; upstream hosts sorted by latency. |
| parable/cheap | Lowest cost per token; upstream hosts sorted by price. |
| parable/best | Highest quality tier; reasoning models allowed. |
| parable/reasoning | Only models with extended thinking. |
| parable/image | Image‑output models; images arrive on message.images[]. |
03 · Request extensions
object under parable
object under parable
| prefer | cost | speed | quality | balanced | Weighting used when scoring candidates. |
| max_cost_usd | number | Hard ceiling; models that could exceed it are excluded. |
| max_latency_ms | number | Excludes models whose p50 exceeds the target. |
| require | capability[] | tools · vision · json · reasoning · long_context · image_gen |
| fallback | boolean | Retry the next candidate on 429 / 5xx / timeout. |
| web_search | boolean | Ground with live web results; citations in annotations. |
| private | boolean | Only zero‑retention, no‑training upstream providers. |
| tools | (chain | sec | market)[] | Server‑side tool packs; the gateway runs the agent loop. |
04 · Tools
Enable packs with parable.tools. The gateway adds the functions, runs the model↔tool loop (up to six rounds), streams each call and result as parable events, and returns the summed usage. Your own tools pass through untouched.
const res = await client.chat.completions.create({
model: "parable/auto",
messages: [{ role: "user", content: "What's in wallet 0x5fc5…d168 and what did USDG do today?" }],
// @ts-expect-error Parable extension
parable: { tools: ["chain", "market"] },
});
// The gateway ran the tool loop server-side; res.usage is the summed cost.| get_balance | ETH + USDG/WETH + indexed ERC‑20 holdings of an address |
| get_transaction | Status, fee, decoded ERC‑20 transfers |
| get_address_info | Wallet / contract / token, metadata, activity |
| get_token_info | ERC‑20 metadata, supply, holders, price |
| get_recent_transfers | Recent transfers for a token or address |
| get_chain_stats | Latest block, gas, block time, totals |
| search_chain | Explorer search for tokens, contracts, labels |
| search_sec_filings | EDGAR full‑text search across forms |
| get_crypto_price | Spot USD prices for major assets |
| get_stock_quote | Delayed equity/ETF quotes |
05 · Response headers
| x-parable-request-id | Correlates with usage and logs. |
| x-parable-model | Model that served the request, after fallbacks. |
| x-parable-cost-usd | Price charged, 6 dp. 1 USDG = 1 USD. |
| x-parable-latency-ms | Wall‑clock time at the gateway. |
06 · Endpoints
| POST | /v1/chat/completions | OpenAI‑compatible; SSE streaming; accepts parable extensions. |
| GET | /v1/models | Catalog with pricing, context, capabilities, live latency. |
| POST | /v1/parable/route | Dry run: ranked candidates and why others were rejected. |
| GET | /v1/parable/stats | Public network metrics. |
| GET | /v1/parable/chain | Live Robinhood Chain snapshot (block, gas, USDG supply). |
| GET | /v1/parable/pricing | Price sheet per model and route, in USDG. |
07 · Access & payments
| API keys | Bearer keys with per‑key rate limits and spend caps. | phase 1 |
| USDG credits | Deposit USDG on Robinhood Chain; the balance draws down per request at the published price. | phase 3 |
| x402 pay‑per‑request | No account: call the API, receive a 402 with a USDG quote, retry with a signed payment. | phase 3 |