# Choosing a model (/docs/entwickler/choose-a-model)

> Pick a model by security level, capability and speed, choose it at runtime from GET /v1/ai/models and start from recommendations per task.

Every request names a `model`. Three questions decide which one, in this order:

1. **Security level:** which level may your data go to? Your data rules decide this before anything else.
2. **Capabilities:** does the model support the endpoint, images or tools you need?
3. **Speed, quality and tokens:** among the models that remain, which one fits the task best?

Measurements on this page are from the live API on 11.11.2026. Models change, so read the current list from [`GET /v1/ai/models`](/docs/entwickler/models) instead of relying on this page.

## Security level
Every model in the list has `security_levels` with two numbers from 1 to 5: `without_anon` for a normal request and `with_anon` for a request with [`"anonymize": true`](/docs/entwickler/anonymisation). They map to three badges:

| `security_levels` | Badge |
|---|---|
| 1 or 2 | [Schweiz] |
| 3 | [EU] |
| 4 or 5 | [Extern] |

[Which data belongs on which level](/docs/sicherheit/sicherheitsstufen#welche-daten) (German) explains what each badge suits. Personal data and confidential business data belong on [Schweiz]. Treat a missing or unknown level like [Extern].

If your code picks the model, filter by level in code, as shown [below](#runtime). Then a change in the catalogue can't move your data to another level without you noticing.

## Capabilities
`meta.capabilities` says what a model supports:

| Flag | `true` means |
|---|---|
| `chat_completions` | The model answers on `/v1/ai/chat/completions`. |
| `responses` | The model answers on `/v1/ai/responses`. With `false`, that endpoint returns `400` with `unsupported_endpoint`. |
| `vision` | The model reads images in messages. |

For the endpoint flags, `null` means "not confirmed": the request is attempted. For `vision`, require `true`. In our tests, models without it either failed with `500` or answered without seeing the image: `mistral-small-swiss` called a red square "Black". On 11.11.2026, no model on the [Schweiz] level had `vision: true`.

Two capabilities aren't flags. Which models call tools: [Tool calling › Which models](/docs/entwickler/tool-calling#models). Which models reason and how to control it: [Reasoning › Models](/docs/entwickler/reasoning#models).

## Choose at runtime
Read the list once, keep the models on the level you need with the capability you need, then take the first one from your own order of preference. If none is left, stop with an error rather than falling back to any model.

**curl**

```bash
curl -s https://api.peakprivacy.ch/v1/ai/models \
  -H "Authorization: Bearer $PEAKPRIVACY_API_KEY" \
  -H "Accept: application/json" \
| jq -r '.data[]
    | select((.security_levels.without_anon // 99) <= 2 and .meta.capabilities.chat_completions == true)
    | .id'
```

```text
deepseek-v4-flash
glm5
mistral-small-swiss
gpt-swiss
```

**Python**

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.peakprivacy.ch/v1/ai",
    api_key=os.environ["PEAKPRIVACY_API_KEY"],
)

# Security level (1 to 5) -> badge. Treat unknown levels like Extern.
TIERS = {1: "schweiz", 2: "schweiz", 3: "eu", 4: "extern", 5: "extern"}

def models_for(tier, capability="chat_completions", anonymize=False):
    """Ids of the listed models on this tier that support the capability."""
    key = "with_anon" if anonymize else "without_anon"
    ids = []
    for model in client.models.list():
        level = model.security_levels.get(key)
        capabilities = model.meta.get("capabilities", {})
        if TIERS.get(level, "extern") == tier and capabilities.get(capability) is True:
            ids.append(model.id)
    return ids

swiss = models_for("schweiz")
print("Swiss models:", ", ".join(swiss))

# Your order of preference. The first listed model wins.
PREFERRED = ["deepseek-v4-flash", "mistral-small-swiss", "glm5", "gpt-swiss"]
model = next((m for m in PREFERRED if m in swiss), None)
if model is None:
    raise RuntimeError("No Swiss model with chat completions is listed.")

completion = client.chat.completions.create(
    model=model,
    messages=[{"role": "user", "content": "Reply in one sentence: what is a credit note?"}],
)
print(f"{model}: {completion.choices[0].message.content}")
```

```text
Swiss models: deepseek-v4-flash, glm5, mistral-small-swiss, gpt-swiss
deepseek-v4-flash: A credit note is a document issued by a seller to a buyer that reduces the amount owed …
```

**JavaScript**

```js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.peakprivacy.ch/v1/ai",
  apiKey: process.env.PEAKPRIVACY_API_KEY,
});

// Security level (1 to 5) -> badge. Treat unknown levels like Extern.
const TIERS = { 1: "schweiz", 2: "schweiz", 3: "eu", 4: "extern", 5: "extern" };

async function modelsFor(tier, capability = "chat_completions", anonymize = false) {
  const key = anonymize ? "with_anon" : "without_anon";
  const ids = [];
  for await (const model of client.models.list()) {
    const level = model.security_levels?.[key];
    const capabilities = model.meta?.capabilities ?? {};
    if ((TIERS[level] ?? "extern") === tier && capabilities[capability] === true) {
      ids.push(model.id);
    }
  }
  return ids;
}

const swiss = await modelsFor("schweiz");
console.log("Swiss models:", swiss.join(", "));

// Your order of preference. The first listed model wins.
const PREFERRED = ["deepseek-v4-flash", "mistral-small-swiss", "glm5", "gpt-swiss"];
const model = PREFERRED.find((id) => swiss.includes(id));
if (!model) throw new Error("No Swiss model with chat completions is listed.");

const completion = await client.chat.completions.create({
  model,
  messages: [{ role: "user", content: "Reply in one sentence: what is a credit note?" }],
});
console.log(`${model}: ${completion.choices[0].message.content}`);
```

```text
Swiss models: deepseek-v4-flash, glm5, mistral-small-swiss, gpt-swiss
deepseek-v4-flash: A credit note is a document issued by a seller to a buyer that reduces the amount previously invoiced …
```

`security_levels` and `meta` are PeakPrivacy fields. The OpenAI SDKs pass them through: as attributes in Python, as properties in JavaScript. For images, call `models_for("eu", capability="vision")`. For a request with `anonymize`, pass `anonymize=True` so the filter reads `with_anon`.

The list is the same for every token and changes when PeakPrivacy adds or retires models. Reading it at startup, or caching it for a few minutes, is enough.

## Speed, quality and tokens
We sent the same short question to each model twice. Relative results:

- **Short prompts:** most answers took a few seconds. Single calls varied more than models did: the same request to the same model took from about one second to over ten. Measure with your own prompts before you choose for speed.
- **Reasoning costs tokens:** `deepseek-v4-flash`, `glm5`, `gpt-swiss` and `gpt-eu` reasoned even for a one-sentence answer. Reasoning tokens count as output tokens and add time on hard questions. `mistral-small-swiss`, `qwen-3-fast` and `gpt-4.1` answered without reasoning.
- **Outlier:** `gemini-3.5-flash` was the slowest and used several times as many completion tokens as the others for the same sentence.
- **Perceived speed:** with [streaming](/docs/entwickler/chat-completions#streaming), the first words arrive while the model is still writing.
- **Quality:** start with a [Schweiz] model. In our invoice extraction test, `gpt-swiss`, `deepseek-v4-flash` and `glm5` got every field right. `mistral-small-swiss` copied values well but often got derived values wrong, see [Getting JSON back](/docs/entwickler/json-output#models). Move to another level only if no Swiss model does the task well enough and your data allows it. Compare two models with the same prompts.
- **Tokens:** `usage` reports the tokens of each request.

## Recommendations by task
| Task | Start with | If your rules allow it | Notes |
|---|---|---|---|
| Extraction, classification | `gpt-swiss`, `deepseek-v4-flash` | `qwen-3-fast` [EU] | Set `temperature` to 0 and ask for JSON in the prompt: `response_format` is dropped. See [Getting JSON back](/docs/entwickler/json-output#models). |
| Drafting, summaries, translations | `deepseek-v4-flash`, `glm5` | `claude-sonnet`, `gpt-4.1` [Extern] | Compare two models with your own texts. |
| Calculations, planning, multi-step reasoning | `gpt-swiss` with `"reasoning_effort": "high"` | `gpt-5` [Extern] on `/responses` with `reasoning.effort` | See [Reasoning](/docs/entwickler/reasoning#models). |
| Long documents | `deepseek-v4-flash` | `gpt-4.1`, `gemini-3.5-flash` [Extern] | A prompt above the context window fails with `400` or, depending on the model, `500`, see [The model rejects the request](/docs/entwickler/errors#model-rejected). Split the document or [search uploaded files](/docs/entwickler/files#search). |
| Images | No model on this level | `gemma-3` [EU], `gpt-4.1`, `claude-sonnet` [Extern] | Require `vision: true`. Images often show personal data. |
| Tool calling | `deepseek-v4-flash`, `mistral-small-swiss` | `qwen-3` [EU], `gpt-4.1`, `claude-sonnet` [Extern] | Gemini models and `gemma-3` ignore tools. See [Tool calling](/docs/entwickler/tool-calling#models). |

"Start with" lists models on the [Schweiz] level.

## All models
A hand-maintained overview with German labels, taken from the web app. Its notes column ("Hinweis") and its footer describe the chat. Where the table differs from `GET /v1/ai/models`, the endpoint is right.

| Modell | ID | Stufe | Modellfamilie |
|---|---|---|---|
| GPT Swiss | `gpt-swiss` | Schweiz | gpt-oss-120b (OpenAI, Open Weight) |
| DeepSeek V4 Flash | `deepseek-v4-flash` | Schweiz | DeepSeek (Modell dahinter: DeepSeek V4.1 Flash, Vorschau) |
| GLM 5.2 | `glm5` | Schweiz | GLM (Zhipu AI) |
| Mistral Small Swiss | `mistral-small-swiss` | Schweiz | Mistral |
| GPT EU | `gpt-eu` | EU | gpt-oss-120b (OpenAI, Open Weight) |
| Qwen 3 | `qwen-3` | EU | Qwen3 235B (Alibaba) |
| Qwen 3 Fast | `qwen-3-fast` | EU | Qwen3 30B (Alibaba) |
| Gemma 3 | `gemma-3` | EU | Gemma 3 27B (Google, Open Weight) |
| DeepSeek R1 | `deepseek-r1` | EU | DeepSeek (Modell dahinter: DeepSeek V4 Pro) |
| GPT-5 | `gpt-5` | Extern | OpenAI (Modell dahinter: GPT-5.6 Sol bzw. GPT-5.2) |
| GPT-4.1 | `gpt-4.1` | Extern | OpenAI |
| GPT-4o | `gpt-4o` | Extern | OpenAI |
| Claude Opus 5.5 | `claude-opus` | Extern | Anthropic |
| Claude Sonnet 4.6 | `claude-sonnet` | Extern | Anthropic |
| Gemini 3.1 Pro (Preview) | `gemini-3-pro-preview` | Extern | Google |
| Gemini 3.5 Flash | `gemini-3.5-flash` | Extern | Google |

Welche Modelle verfügbar sind, legt die Organisation fest; massgeblich ist die Modellauswahl im Chat bzw. `GET /v1/ai/models`.

## See also
- [Models](/docs/entwickler/models)
- [Security levels](/docs/sicherheit/sicherheitsstufen) (German)
- [Anonymisation](/docs/entwickler/anonymisation)
- [Tool calling](/docs/entwickler/tool-calling)
