Presets and files

Why change the model and settings in code each time, when you can change them once from the panel?

6 minLesson 7 of 80 of 4 steps

Say your app runs on one model with one system prompt, and you want to change the model. Without a preset you change the code and redeploy. With one, you change it in the panel and you're done.

What a preset is

A preset keeps a model, fallback models and settings under one name. In a request, instead of a model name, you write:

JSON
"model": "@preset/code-review"

The wizard has four steps: Name and ID, Models, Settings and Review. Settings offers:

  • System prompt: text the model always reads before the request.
  • Temperature: from more exact to more varied.
  • Output token cap and reasoning depth.
  • Web search: the model can search the web, and each search is billed separately.

You can add up to two fallback models. If the main model doesn't answer, the next is tried, and only the one that answers costs anything.

Each preset belongs to one workspace, and a key can call only its own workspace's presets.

Make a preset0 of 4 steps

  1. From the Create menu at the top, choose Preset.
  2. Name it "Summariser" and pick a cheap model.
  3. Write the system prompt: "Summarise any text in three plain sentences."
  4. Call it once with @preset/ and its id.
Go to presets

Files

If you give a model the same file repeatedly, upload it once in Files and send it by id afterwards. PDF, Word, Excel, PowerPoint, images, audio, CSV, JSON, Markdown and text are accepted. The type is read from the content, not the extension.

The same works from code, in the standard POST /v1/files form:

Shell
curl https://iranrouter.com/v1/files \
  -H "Authorization: Bearer ir-..." \
  -F purpose=user_data \
  -F file=@report.pdf

Each workspace has its own space, and what's used shows at the top of the Files page.

What you learned

  • A preset takes the model and settings out of your code.
  • Call it with @preset/id.
  • Upload a file once and send it by id.
Limits and errorsEvery error is a sentence saying what happened and whose move it is. Let's learn to read them.Done, next lesson