opendunes
Helpers · 3 min
Copy page ▾

Model search

Let a model look up which models fit a job, by what they read, what they write and how much they remember.

  1. What it does.
  2. Name it in tools.
  3. Limit the results.
  4. Read what it bills on.

This page is one 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 list of helpers, and how the charge adds up, sit in Helpers.

1. What it does

The model asks the helper a question about the catalogue and reads the matches before it answers. An empty search browses the whole list. This is the helper to give an assistant that recommends a model, or that picks one for the next call it makes.

Typeopendunes:experimental__search_models
Routes/v1/chat/completions, /v1/responses and /v1/messages
A stepone search
Stepsat most 30 a request
Bills ontokens only

The helper is experimental. Its name may lose the experimental__ prefix when it graduates, and a request that names the old spelling would then be refused.

2. Name it in tools

Souk Bot suggests a model to a builder. The sample lets the model search the catalogue up to three times and prints the answer and the charge.

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-4.5"
PROMPT = "Which models read a picture and answer in text?"

body = {
    "model": MODEL,
    "messages": [{"role": "user", "content": PROMPT}],
    "tools": [
        {
            "type": "opendunes:experimental__search_models",
            "parameters": {"max_results": 5},
        }
    ],
    "max_tool_calls": 3,
}
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:
    answer = json.load(response)

print(answer["choices"][0]["message"]["content"])
print(answer["usage"]["cost"])

The answer is a 200. Name the helper by its type, opendunes:experimental__search_models; any other spelling of the type is a 400.

3. Limit the results

Put this in the helper's parameters.

ParameterDoes
max_resultsthe most models one search returns: 5 by default, from 1 to 20

The model writes each search itself, and every field of it is optional.

The model sendsMatches
queryfree text against names, slugs and descriptions
input_modalitiesmodels that read all of these: text, image, file, audio, video
output_modalitiesmodels that write all of these, such as text, image, embeddings, audio
min_context_lengthmodels that remember at least this many tokens
seriesa family, such as Claude, GPT or Gemini

Each match comes back to the model with its id, name, description, context_length, input_modalities, output_modalities and series, beside total_results, how many models fit, and showing, how many came back.

Check an id the model suggests in Models before you send it as model. A request that names a model that is not on sale answers 404.

4. Read what it bills on

No charge beyond the model's tokens. The matches the model reads are input tokens, so a higher max_results costs more input. usage.cost carries the whole of it.

Before the model starts, OpenDunes holds money from your wallet for the words and the answer. A search costs no money of its own, so the hold sets no step limit lower than yours: a request runs at most 30 steps, or the max_tool_calls you name. The helper runs no other model and no sandbox, so it has no spend cap.

Don't

Don't leave max_results at its widest for a question one match answers. Every match is input on every later turn.

Do

Set max_tool_calls to the few searches the question needs, and check the model it names before you call it.