Drex

Select a candidate model

Each successful call is billed per encoded input token measured by the router, including the conversation and candidate profiles; see Pricing. Only a 200 is charged, and the maximum encoded-input cost is reserved before dispatch. Only measured tokens are settled; the remainder is released. An account that cannot fund the ceiling gets 402 before the router runs, even if its eventual charge would have fit.

POST
/v1/route

Each successful call is billed per encoded input token measured by the router, including the conversation and candidate profiles; see Pricing. Only a 200 is charged, and the maximum encoded-input cost is reserved before dispatch. Only measured tokens are settled; the remainder is released. An account that cannot fund the ceiling gets 402 before the router runs, even if its eventual charge would have fit.

Authorization

bearerAuth
AuthorizationBearer <token>

Your API key, sent as Authorization: Bearer nace_sk_...

  • Where: the dashboard's API Keys page. It is shown once, when you create it.
  • Format: nace_sk_ followed by 43 URL-safe characters (A-Z, a-z, 0-9, _ and -).
  • Limit: an account can hold at most 3 active keys.
  • Wrong or missing key: returns 401 authentication_error.

In: header

Request Body

application/json

A text conversation and the candidate models to choose from.

At most 100000 characters of candidate text, within a 4 MiB body. The encoded conversation is also limited to 32768 tokens.

messagesarray<RouteMessage>required
Items1 <= items <= 1024
Show child attributes
candidatesarray<string | RouteCandidateProfile>required

Unique candidate IDs. A bare ID must be a known profile; give a full profile for any other model.

Items1 <= items <= 255
Show child attributes
selection_prioritystring

quality prefers the strongest candidate, cheapest the lowest price, and balanced weighs both. The default is balanced.

Default"balanced"
Value in"quality""balanced""cheapest"
cost_weightnumberdeprecated

Deprecated: use selection_priority. 0 favors quality, 1 favors price. Do not send both.

Range0 <= value <= 1

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/route" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "role": "user",        "content": "Explain this invoice"      }    ],    "candidates": [      "openai/gpt-6-luna",      "google/gemini-3.8-flash"    ],    "selection_priority": "balanced"  }'
{  "selected": "string",  "probabilities": {    "property1": 0,    "property2": 0  },  "request_id": "string"}