Skip to content

Migrating from OpenRouter ​

Both are OpenAI-compatible gateways with <author>/<model> IDs, so most code moves by changing the base URL and key:

diff
- baseURL: "https://openrouter.ai/api/v1",
- apiKey: process.env.OPENROUTER_API_KEY,
+ baseURL: "https://api.usefully.info/v1",
+ apiKey: process.env.USEFULLY_API_KEY,

Model IDs ​

Check each model you use against GET /v1/models. Common models use the same IDs (anthropic/claude-sonnet-5-5, anthropic/claude-haiku-5-5). Variant suffixes such as :free or :nitro aren't supported; use provider.sort instead (below).

Provider routing ​

Usefully's provider object covers the same ground:

OpenRouterUsefully
provider.orderprovider.order
provider.allow_fallbacksprovider.allow_fallbacks
provider.only / provider.ignoreprovider.only / provider.ignore
provider.sort (price, throughput, latency)provider.sort (same values)
provider.max_price (prompt, completion)provider.max_price (input, output), USD per million tokens
provider.data_collection: "deny"provider.data_policy: "no_training" (or "zdr")
models: [...] fallback listNot supported yet; fallback is across providers of one model

Provider IDs are lowercase (groq, together, anthropic); see each model's providers in the catalog.

Headers and extras ​

  • HTTP-Referer and X-Title aren't needed and are ignored.
  • Beyond chat, the same key also does embeddings and web search.

Billing ​

Both are prepaid with pass-through token prices. Usefully adds a 3.5% fee on credit purchases and no per-request markup on tokens. See Billing.