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 request
02 · Routes
parable/autoBalanced cost, speed and quality. Short prompts lean fast.
parable/fastLowest latency; upstream hosts sorted by latency.
parable/cheapLowest cost per token; upstream hosts sorted by price.
parable/bestHighest quality tier; reasoning models allowed.
parable/reasoningOnly models with extended thinking.
parable/imageImage‑output models; images arrive on message.images[].
03 · Request extensions
object under parable
prefercost | speed | quality | balancedWeighting used when scoring candidates.
max_cost_usdnumberHard ceiling; models that could exceed it are excluded.
max_latency_msnumberExcludes models whose p50 exceeds the target.
requirecapability[]tools · vision · json · reasoning · long_context · image_gen
fallbackbooleanRetry the next candidate on 429 / 5xx / timeout.
web_searchbooleanGround with live web results; citations in annotations.
privatebooleanOnly 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_balanceETH + USDG/WETH + indexed ERC‑20 holdings of an address
get_transactionStatus, fee, decoded ERC‑20 transfers
get_address_infoWallet / contract / token, metadata, activity
get_token_infoERC‑20 metadata, supply, holders, price
get_recent_transfersRecent transfers for a token or address
get_chain_statsLatest block, gas, block time, totals
search_chainExplorer search for tokens, contracts, labels
search_sec_filingsEDGAR full‑text search across forms
get_crypto_priceSpot USD prices for major assets
get_stock_quoteDelayed equity/ETF quotes
05 · Response headers
x-parable-request-idCorrelates with usage and logs.
x-parable-modelModel that served the request, after fallbacks.
x-parable-cost-usdPrice charged, 6 dp. 1 USDG = 1 USD.
x-parable-latency-msWall‑clock time at the gateway.
06 · Endpoints
POST/v1/chat/completionsOpenAI‑compatible; SSE streaming; accepts parable extensions.
GET/v1/modelsCatalog with pricing, context, capabilities, live latency.
POST/v1/parable/routeDry run: ranked candidates and why others were rejected.
GET/v1/parable/statsPublic network metrics.
GET/v1/parable/chainLive Robinhood Chain snapshot (block, gas, USDG supply).
GET/v1/parable/pricingPrice sheet per model and route, in USDG.
07 · Access & payments
API keysBearer keys with per‑key rate limits and spend caps.phase 1
USDG creditsDeposit USDG on Robinhood Chain; the balance draws down per request at the published price.phase 3
x402 pay‑per‑requestNo account: call the API, receive a 402 with a USDG quote, retry with a signed payment.phase 3