opendunes
Models and routing · 3 min
Copy page ▾

Latest model and suffixes

Name the newest model of a family, and steer which providers serve it.

  1. Ask for the newest model of a family.
  2. Add a suffix to steer the providers.
  3. Leave the retired suffixes out.

1. Ask for the newest model of a family

Write ~, the lab, and the family with -latest. The request goes to the newest model of that family, whichever it is the day you send it.

You sendYou get
~anthropic/claude-sonnet-latestthe newest Sonnet
~google/gemini-flash-latestthe newest Gemini Flash
~openai/gpt-mini-latestthe newest mini model of OpenAI

Each alias is a line of the catalogue: copy it from there, as you copy any model IDModel IDThe name a request calls a model by, lab/model, copied from Models.More on Models →.

import json
import os
import urllib.request

API_KEY = os.environ["OPENDUNES_API_KEY"]
ADDRESS = "https://opendunes.com/v1/chat/completions"
MODEL = "~anthropic/claude-sonnet-latest"
PROMPT = "Write a one-line welcome for a bakery in Tlemcen."

body = {
    "model": MODEL,
    "messages": [{"role": "user", "content": PROMPT}],
}

request = urllib.request.Request(
    ADDRESS,
    data=json.dumps(body).encode(),
    headers={
        "Authorization": "Bearer " + API_KEY,
        "Content-Type": "application/json",
    },
)
with urllib.request.urlopen(request) as response:
    reply = json.load(response)

print(reply["model"])
print(reply["choices"][0]["message"]["content"])

The answer's model names the model that really answered, as lab/model. Read it, and log it.

Do

Use an alias for a prototype or a tool that should always be on the newest model. Use the full ID in production code whose answers you have tested.

Watch out

An alias moves the day a newer model of its family arrives: the same request then gets a different model, a different style of answer and a different charge. usage.cost is the charge of the model that answered.

2. Add a suffix to steer the providers

A suffix goes after the model name, after a colon. It does not change the model; it changes which providers are tried first.

SuffixTries first
:nitrothe fastest provider. A priority endpoint may serve it, at that endpoint's price
:floorthe cheapest provider. A flex endpoint may serve it, at that endpoint's price
:exactothe providers sorted for reliable tool calls

Write it on the ID: anthropic/claude-sonnet-4.5:nitro. Among :nitro, :floor and :exacto, the last one wins.

Good to know

A request that names no routing goes to the cheapest provider first. For an order of your own, a list to pick from or a ceiling on the price, use the provider field: Provider routing.

The key's list of models matches a model by its name without suffixes. A key that may use anthropic/claude-sonnet-4.5 may use anthropic/claude-sonnet-4.5:nitro.

Watch out

When no provider meets the ordering you asked for, the request fails with a 503.

3. Leave the retired suffixes out

Four more suffixes exist in the supplier's names. None is for new code.

SuffixWhat happensUse instead
:onlineweb search results are attached; retiredRetiredA model withdrawn from sale. A call to its ID returns 404.More on Models → in favour of the web search helperHelperA tool run for you when a model reaches for it mid-answer: a web search, a page read, a sandbox. Named opendunes:‹name›.More on Helpers →the web search helper: Helpers
:thinking · :extendeda 404, unless the model's own page lists that exact namethe model's reasoning field: Parameters
:freea 404: no free model answers on the APIa paid model
:batcha 400 on a single request: only the batch routes pick this entrysend the plain ID; for a batch, Batches

Errors

The body says why. What to do on every status: Errors and retries.

StatusMeans
400a :batch name on a route that takes one request
402the balanceBalanceWhat you can spend, in DA.More on Balance and charges → cannot cover the request
403the key may not use the model
404no such model or alias, a retired model, or a suffix that is not offered
503no provider meets the ordering you asked for