orq.aiAdvent of RoutingDocs

Door 17 · still sealed

Hands off the wax, elf. This door opens on Dec 17.

-days--hours--min--sec

Rudolph is still polishing this one. Back to the calendar

Door 17 · Dec 17 Service tiers

Express or standard delivery

Ask for the cheap lane or the fast lane with one field, then read back the lane you really got, because that is the one you pay for.

A week to Christmas Eve, and the letter-reply desk is a snowdrift. Urgent wish lists and polite thank-you notes share one pile, and they all ride the same sleigh.

  1. Santa

    Every reply goes express tonight! I want the children answered before my cocoa gets cold.

  2. Ledger

    Express for the thank-you notes too? Every token costs more in the fast lane, Santa. That's premium postage on 'thanks for the cookies'.

  3. Santa

    Fine, fine! Thank-yous can take the scenic route. Wish lists ride express.

  4. Tinsel

    Split the pile: fast for wish lists, flex for thank-yous. Then read service_tier on every reply, because that's the lane you get billed for.

clientYour appservice_tier: flexorq.aiAI Routervalidates the tiersells flexopenai/gpt-6-lunareports "flex"no flexanthropic/claude-haiku-5-5reports "default"flexstandard
  1. clientYour appservice_tier: flex
  2. orq.aiAI Routervalidates the tier
  3. sells flexopenai/gpt-6-lunareports "flex"
    no flexanthropic/claude-haiku-5-5reports "default"
The thank-you notes go out flex to two models: gpt-6-luna has a flex lane and takes it, Haiku has none and runs standard, and each reply says which.

How it works

Tinsel’s split is one field per request. A service tier is the processing class a provider runs a request on, and the router passes yours through:

  1. Ask. Set service_tier in the request body. It works on the Responses API and on Chat Completions.
  2. Validate. The router checks the value against the six it accepts. Anything else is rejected before the provider is called.
  3. Serve. The provider runs the request on that tier, where the model sells it. If the model does not sell it, the request does not fail: it runs on the standard tier.
  4. Report. Every response carries service_tier, naming the tier that actually served it. Billing follows that tier.

Try it with curl

curl -X POST https://my.orq.ai/v3/router/responses \
  -H "Authorization: Bearer $ORQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-6-luna",
    "input": "Summarise the thank-you notes",
    "service_tier": "flex"
  }'

Look for "service_tier" in the JSON that comes back. It names the tier that served the request.

Or from the OpenAI SDK

service_tier is a normal argument here, so it needs no extra_body:

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["ORQ_API_KEY"],
    base_url="https://my.orq.ai/v3/router",
)

response = client.responses.create(
    model="openai/gpt-6-luna",
    input="Summarise the thank-you notes",
    service_tier="flex",
)
print(response.service_tier)

Which tier for which job

You send What it means You read back
flex Spare provider capacity, billed below the standard rate flex
fast Premium low-latency processing, billed above the standard rate priority
priority Backward-compatible alias for fast priority
auto, default, scale Standard processing default
nothing Standard processing default

The read-back column assumes the model sells the tier; the response names the tier that served it. Use fast for work someone is waiting on, flex for background work, and leave the field out for everything else.

A model sells a tier only where its pricing declares one. Tiers show up as pricing variants on the model, in the model catalog and on List Models. At the time of writing, the catalog lists flex and priority for openai/gpt-6-luna, while anthropic/claude-haiku-5-5 lists neither. Check again before you rely on it: the set changes as providers revise their line-ups.

Read the tier back

Do not assume your tier was honoured. A model without the tier you asked for answers on the standard tier and reports default, with no error. If you track cost, store the service_tier from the response next to the token counts.

Typos fail early

Any value outside the six is rejected on both endpoints, before the provider call:

{
  "error": {
    "message": "Invalid value for 'ServiceTier': must be one of [auto, default, flex, fast, scale, or priority].",
    "code": "invalid_request_error",
    "param": "ServiceTier"
  }
}

Nice list

  • Send background work with flex. It runs on spare provider capacity, billed below the standard rate.
  • Log service_tier from every response. Billing follows the tier that served the request, not the one you asked for.
  • Check a model's tiers in the model catalog or List Models first. The set differs per model and changes as providers revise their line-ups.

Naughty list

  • Asking for flex on a model that does not sell it and budgeting for the discount. The request runs on the standard tier, at the standard rate, and reports default.
  • Checking the response tier against the request with ==. fast comes back as priority, and auto and scale come back as default.
  • Sending "service_tier": "express" because it sounds right. Anything outside the six accepted values fails with invalid_request_error before the provider is called.

Elf's challenge

Place your bets, then send openai/gpt-6-luna the same request three times: with "service_tier": "fast", with "scale", and with no tier. Which reply names a tier you never sent?

Stuck? Ask Tinsel for a hint

fast is reported as priority. scale and a request with no tier are both reported as default.

Christmas crackerWhy did the Haiku request skip the flex lane?Pull it for the punchline

Haikus only come in one standard form.