Skip to content
Numes

API reference · Compatibility

API guides

OpenRouter compatibility

What the Numes API shares with OpenRouter, every intentional difference, and a checklist for migrating an existing integration.

On this page

Numes implements a subset of the OpenRouter API, which extends the OpenAI Chat Completions API. Request and response shapes, the stream format, the error envelope and the usage object follow OpenRouter, so OpenAI SDK and OpenRouter-style clients usually work after changing the base URL and key. Every deliberate difference is listed here; most exist so the API never appears to honor something it doesn't, or so billing stays exact. This page was last reviewed against OpenRouter's documentation in September 2026.

Endpoints

EndpointNotes
GET /modelsFilters output_modalities and supported_parameters; four sort orders; prices in your key's currency
GET /models/{author}/{slug}/endpointsPer-endpoint pricing, limits, parameters and routing tag
POST /chat/completionsBuffered and streamed; tools, structured outputs, reasoning, caching, multimodal input
GET /generationIts own field set; see Billing and delivery
POST /embeddingsText, token and multimodal inputs
POST /imagesBuffered or streamed, base64 output
POST /audio/speechMP3, PCM and WAV
POST /audio/transcriptionsMultipart or JSON input; json and verbose_json output
GET /keyThe current key's metadata; inference or management key
GET, POST /keys; GET, PATCH, DELETE /keys/{hash}Management key; manages inference keys only
GET /creditsManagement key; requires currency=USD or currency=BTC
POST /e2ee/resolve, POST /e2ee/chat/completionsExtension for encrypted inference

Request shape

BehaviorOpenRouterNumesWhat to do
Unknown request fieldsGenerally ignoredChat forwards ordinary generation hints; gateway-owned controls have separate validationUse Parameters to check which controls the gateway handles
Models per requestmodels array falls back across modelsExactly one: model, or models with one entryImplement model fallback in your client
Requested featuresUnsupported parameters may be ignoredTools, response_format, reasoning, cache directives and output modalities are hard requirements; no matching endpoint returns 503 provider_unavailable. Unsupported sampling parameters are omitted unless provider.require_parameters is trueCheck supported_parameters before sending a feature
Output limitLarge values acceptedmax_tokens and max_completion_tokens must be 1–131,072, otherwise 400. When omitted, the endpoint's own maximum appliesUse the model's top_provider.max_completion_tokens or less
Unknown modelAn error naming the invalid model503 provider_unavailable, the same response as any request no endpoint can serveCopy IDs from GET /models
Message nameAccepted on any roleAccepted only on tool messages, and not forwardedRemove name from other roles
File referencesOpenAI-style file_idfile_id is rejected; chat audio must be inline base64Send PDFs as HTTPS or data: URLs and audio as base64
X-Request-IdNo uniqueness ruleUnique per account; reusing a recorded ID returns 400Omit it, or send a new value on every call, including retries
Browser requestsAllowedThird-party origins get 403 cors_forbiddenCall the API from your server

Routing

BehaviorOpenRouterNumesWhat to do
max_price unitsDollars per million tokensPer unit (per token for text) in the key's currency; also caps separately priced reasoning and cache-write ratesDivide OpenRouter values by 1,000,000; use satoshis for BTC keys
Default routingPrice-weighted load balancingBalances price, reliability and performance across eligible endpointsUse provider.sort or order for a deterministic order
provider.sortprice, throughput, latency, or an objectThe three strings plus quality; no object formUse the string form
Data residencySeparate EU base URLprovider.regions filters on endpoint-declared countries and regionsSend provider.regions
Other provider fieldsPercentile performance preferences, distillation filters and moreAccepted: order, allow_fallbacks, require_parameters, data_collection, zdr, only, ignore, quantizations, regions, sort and max_price. Others return 400Remove the rest

Pricing and currency

BehaviorOpenRouterNumesWhat to do
CurrencyUSD creditsEach key has a fixed currency, USD or BTC (in satoshis), for prices, costs and limits. No conversionPick the currency when you create the key
Creating keysPOST /keys without currencybilling_currency is required and can't be changedAdd billing_currency to create calls
Upstream costAggregate plus prompt and completion splitAggregate cost_details.upstream_inference_cost onlyUse GET /generation for detail
Media usageSome media counted as tokensImage counts and audio seconds are separate usage fieldsRead input_images, output_images, input_audio_seconds, output_audio_seconds
Prompt cachingProvider cache pricingCache rates never exceed the prompt rateNo action needed
Money in JSONNumbersNumbers written from exact decimals; prices are decimal stringsParse as decimals when you add amounts

Billing and delivery

BehaviorOpenRouterNumesWhat to do
What you pay forVaries by request typeOutput delivered to you; GET /generation is the authoritative recordNo action needed
Usage opt-inusage.include, stream_options.include_usageUsage is always returned; both fields are accepted and ignoredRead usage from every response
Final usage chunkCan include a choicechoices: [] with usageSkip chunks with an empty choices array when reading content
FallbackAcross providers and modelsAcross endpoints of the requested model, only before output reaches youTreat mid-stream errors as final
Stream keep-alives: OPENROUTER PROCESSING commentsNoneUse a read timeout of several minutes
GET /generation fieldsOpenRouter's generation statsOutcome, delivery state, exact costs and a breakdown of each endpoint tried; never contentSee Usage accounting

Model discovery

BehaviorOpenRouterNumesWhat to do
Which models are listedThe whole catalogueOnly models with an available endpoint priced in your key's currencyExpect different lists for USD and BTC keys
One model rowModel-level summaryDescribes one representative endpointUse the endpoints API for every endpoint
Filters and sortingMany filters and searchoutput_modalities, supported_parameters and four sorts; no pagination or searchFilter client-side
PricesRates you payProvider rates, which are what requests are chargedExpect usage.cost to equal upstream_inference_cost

Media

BehaviorOpenRouterNumesWhat to do
PDFsParsed for any modelRouted only to endpoints that accept file inputPick a model whose endpoints list file input
Generated imagesURL or base64Base64 onlyDecode b64_json
TranscriptionSeveral formatsjson and verbose_json; prompt accepted and ignored; no word or segment timestampsUse json
Image or audio output from chatSupported on some modelsOnly from endpoints that declare the output; otherwise 503Use /images and /audio/speech

Headers, errors and keys

BehaviorOpenRouterNumesWhat to do
X-OpenRouter-Metadataenabledenabled, or true; chat only; never on error bodiesSend enabled
HTTP-Referer, X-TitleApp attribution and rankingsHTTP-Referer groups your own Activity; X-Title is ignored; neither reaches providersNo action needed
Error metadataCan include provider name and raw upstream errorerror_type only; upstream messages are never relayedBranch on status and error_type
Key metadataIncludes is_free_tier, is_provisioning_key, rate_limit and BYOK fieldsThose are omitted; billing_currency is addedDon't depend on the omitted fields
Management keysCreated through the APICreated and revoked in the dashboardCreate them in Keys
Structured outputsProvider-enforcedSchema adherence depends on the model and endpointValidate the parsed result

Unsupported OpenRouter features

Unimplemented endpoints return 404. Chat rejects settings that would bypass gateway execution or privacy controls.

  • Other API shapes: the Responses API, the Anthropic Messages API, legacy /completions and video generation.

  • Account features: bring-your-own-key, presets, OAuth sign-in for third-party apps, the analytics API, workspaces, guardrails and customer webhooks.

  • Model shortcuts: variants such as :free, :nitro, :floor, :online or :thinking; ~author/model aliases; multi-model fallback through models or route.

  • Plugins and transforms: the plugins field, response caching and transforms. For web search, use the hosted web_search tool; see Hosted tools.

  • Search and choices: web_search_options and requesting more than one choice with n return 400.

  • Other OpenAI fields: store: true, service_tier other than default, and legacy functions and function_call (use tools and tool_choice).

Penalty samplers (frequency_penalty, presence_penalty, repetition_penalty) and min_p or top_a are forwarded as numeric hints. Chat also forwards ordinary hints such as logit_bias, logprobs, top_logprobs, prediction and verbosity to compatible sources. Token log probabilities are not returned in the public response. Use require_parameters if the endpoint must declare the hints you send.

Additive fields

Responses carry some fields OpenRouter doesn't define. Clients that ignore unknown fields are unaffected.

FieldWhereMeaning
billing_currencyModels, endpoints, key metadataThe currency of every price and amount for this key
usage_meterModels, endpoints, usageIdentifies the usage contract that prices the offer; treat it as opaque
token_count_basisUsageprovider_native when token counts come from the provider, gateway_estimate otherwise
native_tokensUsageThe provider's token counts, including reasoning and cache classifications
gateway_billing_unitsUsageBilling quantities on some older requests; absent on current offers
hosted_tool_usageUsageQuantities of each hosted tool used
maximum_output_length, embeddings, supported_hosted_tools, reasoningModels, endpointsOutput ceiling, embedding support, hosted tools and reasoning capabilities
accessModelsPresent on models shared with one of your organizations
pricing_basis, reference, usd_ratesModel pricingPresent on BTC prices that track a USD price
provider.regions, provider.sort: "quality"Chat requestRouting extensions; see Parameters

Migrate from OpenRouter

  1. Change the base URL and key

    Point your client at https://api.numes.ai/api/v1 and use an inference key from Keys. With the OpenAI SDK, only the base URL and API key change.

  2. Pick the key currency

    Choose USD or BTC when you create the key. Prices, usage.cost and limits come back in that currency, and BTC amounts are satoshis. Fund the matching balance in Billing.

  3. Use one model ID per request

    Check IDs against GET /models. Remove variant suffixes and ~ aliases, and replace multi-model models arrays with one model. For model fallback, catch 503 provider_unavailable and retry with your next model.

  4. Remove unsupported fields

    Remove blocked settings such as plugins and web_search_options. For reasoning, send reasoning: {effort}. A forwarded hint can still be refused by the endpoint; check the field named in the error against Parameters.

  5. Convert routing preferences

    Divide max_price values by 1,000,000, use string sort values, and replace EU base-URL routing with provider.regions. Selectors for order, only and ignore come from the tag field of the endpoints API.

  6. Update keys, balances and retries

    Add billing_currency to POST /keys calls, create management keys in the dashboard, and add currency to GET /credits calls. Send a fresh X-Request-Id on every retry, or none, and retry only before a stream starts; see Retry strategy.

Next steps