# 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](#1-ask-for-the-newest-model-of-a-family).
2. [Add a suffix to steer the providers](#2-add-a-suffix-to-steer-the-providers).
3. [Leave the retired suffixes out](#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 send | You get |
|---|---|
| `~anthropic/claude-sonnet-latest` | the newest Sonnet |
| `~google/gemini-flash-latest` | the newest Gemini Flash |
| `~openai/gpt-mini-latest` | the newest mini model of OpenAI |

Each alias is a line of the [catalogue](/models): copy it from there, as you copy any model ID.

```python
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"])
```

```javascript
const API_KEY = process.env.OPENDUNES_API_KEY;
const ADDRESS = "https://opendunes.com/v1/chat/completions";
const MODEL = "~anthropic/claude-sonnet-latest";
const PROMPT = "Write a one-line welcome for a bakery in Tlemcen.";

const response = await fetch(ADDRESS, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: MODEL,
    messages: [{ role: "user", content: PROMPT }],
  }),
});
const reply = await response.json();

console.log(reply.model);
console.log(reply.choices[0].message.content);
```

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

const (
	address = "https://opendunes.com/v1/chat/completions"
	model   = "~anthropic/claude-sonnet-latest"
	prompt  = "Write a one-line welcome for a bakery in Tlemcen."
)

func main() {
	apiKey := os.Getenv("OPENDUNES_API_KEY")

	body, err := json.Marshal(map[string]any{
		"model": model,
		"messages": []any{
			map[string]any{"role": "user", "content": prompt},
		},
	})
	if err != nil {
		panic(err)
	}

	request, err := http.NewRequest("POST", address, bytes.NewReader(body))
	if err != nil {
		panic(err)
	}
	request.Header.Set("Authorization", "Bearer "+apiKey)
	request.Header.Set("Content-Type", "application/json")

	response, err := http.DefaultClient.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var reply struct {
		Model   string `json:"model"`
		Choices []struct {
			Message struct {
				Content string `json:"content"`
			} `json:"message"`
		} `json:"choices"`
	}
	if err := json.NewDecoder(response.Body).Decode(&reply); err != nil {
		panic(err)
	}
	fmt.Println(reply.Model)
	fmt.Println(reply.Choices[0].Message.Content)
}
```

```bash cURL
ADDRESS="https://opendunes.com/v1/chat/completions"
MODEL="~anthropic/claude-sonnet-latest"
PROMPT="Write a one-line welcome for a bakery in Tlemcen."

curl "$ADDRESS" \
  -H "Authorization: Bearer $OPENDUNES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$MODEL"'",
    "messages": [
      {
        "role": "user",
        "content": "'"$PROMPT"'"
      }
    ]
  }'
```

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

<div class="do">
<p>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.</p>
</div>

<div class="watch-out">
<p>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. <code>usage.cost</code> is the charge of the model that answered.</p>
</div>

## 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.

| Suffix | Tries first |
|---|---|
| `:nitro` | the fastest provider. A priority endpoint may serve it, at that endpoint's price |
| `:floor` | the cheapest provider. A flex endpoint may serve it, at that endpoint's price |
| `:exacto` | the 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.

<div class="good-to-know">
<p>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 <code>provider</code> field: <a href="/docs/provider-routing">Provider routing</a>.</p>
</div>

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`.

<div class="watch-out">
<p>When no provider meets the ordering you asked for, the request fails with a 503.</p>
</div>

## 3. Leave the retired suffixes out

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

| Suffix | What happens | Use instead |
|---|---|---|
| `:online` | web search results are attached; retired in favour of the web search helper | the web search helper: [Helpers](/docs/helpers) |
| `:thinking` · `:extended` | a 404, unless the model's own page lists that exact name | the model's reasoning field: [Parameters](/docs/reference/parameters) |
| `:free` | a 404: no free model answers on the API | a paid model |
| `:batch` | a 400 on a single request: only the batch routes pick this entry | send the plain ID; for a batch, [Batches](/docs/batches) |

## Errors

The body says why. What to do on every status: [Errors and retries](/docs/errors-and-retries).

| Status | Means |
|---|---|
| 400 | a `:batch` name on a route that takes one request |
| 402 | the balance cannot cover the request |
| 403 | the key may not use the model |
| 404 | no such model or alias, a retired model, or a suffix that is not offered |
| 503 | no provider meets the ordering you asked for |
