> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Fusion

> Run one request across a panel of models, have a judge weigh the answers, and return a single response under one gateway model ID.

**Model Fusion** answers a request with several models at once, has a judge compare their answers, and returns one response. Callers use it like any other model: one model ID, one response.

## Use cases

* **Review across providers**: put models from different providers on the panel and read the judge's list of contradictions before shipping an answer or a code change.
* **High-stakes answers**: the **Safety** preset makes the judge weigh physical, financial, legal, and medical risk, and flag it before synthesis.
* **Swap models without touching callers**: the fusion owns the model ID, so changing the panel or the judge leaves client code unchanged.

## Create a Model Fusion

Open **AI Gateway** → **Model Fusion**, then select <kbd> Model Fusion</kbd> in the page header.

| Field | Meaning |
| - | - |
| **Name** | The last segment of the gateway model reference, `<workspace>@orq/<name>`. |
| **Synthesis mode** | Who writes the final answer: **Analysis** or **Judge writes final**. |
| **Preset** | The judging strategy: **General**, **Quality**, **Budget**, **Code**, or **Safety**. |
| **Models** | The panel that answers the request, 1 to 8 chat models. |
| **Judge model** | Compares the panel answers and records where they agree and differ. |
| **Orchestrator model** | Writes the final answer in **Analysis** mode. |
| **Web tools** | Lets the panel and the judge call web tools. |
| **Include raw panel answers** | Passes the panel answers to synthesis alongside the judge's analysis. |
| **Max tool calls** | Tool calls per phase, default 8; `0` turns web tools off. |

The list filters by **Preset** and **Status**, and the switch in the **Status** column turns a fusion on or off without deleting it. The detail page carries **Overview** telemetry, **Traces**, and **Settings**.

> [!NOTE]
>
> Creating or changing a fusion through the SDK or API needs a Management Key with **Model fusions** access. The Model Fusion SDK reference covers the list, create, retrieve, update, enable, disable, and delete calls. Calls to the fusion through the gateway use a regular API Key.

## Use it

Pass the fusion to the gateway as `<workspacename>@orq/<name>`, the same reference form as the [Smart Router](/docs/ai-gateway/smart-router.md).

```bash cURL (Responses API) theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl 'https://router.toqan.ai/eu/v3/router/responses' \
  -H "Authorization: Bearer $TOQAN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "workspace_name@orq/my-fusion",
    "instructions": "You are a helpful assistant.",
    "input": "Summarize the trade-offs."
  }'
```

```typescript TypeScript (Responses API) theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { OpenAI } from 'openai';

const client = new OpenAI({
  baseURL: 'https://router.toqan.ai/eu/v3/router',
  apiKey: process.env.TOQAN_API_KEY,
});

const response = await client.responses.create({
  model: 'workspace_name@orq/my-fusion',
  instructions: 'You are a helpful assistant.',
  input: 'Summarize the trade-offs.',
});

console.log(response.output_text);
```

```python Python (Responses API) theme={"theme":{"light":"github-light","dark":"github-dark"}}
from openai import OpenAI
import os

client = OpenAI(
    base_url='https://router.toqan.ai/eu/v3/router',
    api_key=os.getenv('TOQAN_API_KEY'),
)

response = client.responses.create(
    model='workspace_name@orq/my-fusion',
    instructions='You are a helpful assistant.',
    input='Summarize the trade-offs.',
)

print(response.output_text)
```

```bash cURL (Chat Completions) theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl 'https://router.toqan.ai/eu/v3/router/chat/completions' \
  -H "Authorization: Bearer $TOQAN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "workspace_name@orq/my-fusion",
    "messages": [{ "role": "user", "content": "Summarize the trade-offs." }]
  }'
```

```typescript TypeScript (Chat Completions) theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { OpenAI } from 'openai';

const client = new OpenAI({
  baseURL: 'https://router.toqan.ai/eu/v3/router',
  apiKey: process.env.TOQAN_API_KEY,
});

const completion = await client.chat.completions.create({
  model: 'workspace_name@orq/my-fusion',
  messages: [{ role: 'user', content: 'Summarize the trade-offs.' }],
});

console.log(completion.choices[0]?.message?.content);
```

```python Python (Chat Completions) theme={"theme":{"light":"github-light","dark":"github-dark"}}
from openai import OpenAI
import os

client = OpenAI(
    base_url='https://router.toqan.ai/eu/v3/router',
    api_key=os.getenv('TOQAN_API_KEY'),
)

completion = client.chat.completions.create(
    model='workspace_name@orq/my-fusion',
    messages=[{'role': 'user', 'content': 'Summarize the trade-offs.'}],
)

print(completion.choices[0].message.content)
```

## Synthesis modes

| Mode | Final answer |
| - | - |
| **Analysis** | The **Orchestrator model** writes it from the judge's analysis, plus the raw panel answers when **Include raw panel answers** is on. |
| **Judge writes final** | The judge writes it in the same call, so no orchestrator is used. |

## Presets

The preset changes what the judge weighs.

| Preset | Judge focus |
| - | - |
| **General** | Agreement and contradictions across the panel. |
| **Quality** | Reasoning quality and fidelity to the instructions over style. |
| **Budget** | No tool calls and shorter arrays, so the run costs less. |
| **Code** | Runtime correctness, API misuse, and security. |
| **Safety** | Physical, financial, legal, and medical risk. |

## Limits

* The panel takes 1 to 8 distinct chat models. Provider models only: another fusion cannot sit on the panel.
* **Max tool calls** runs from 0 to 20 per phase. The **Budget** preset keeps web tools off whatever the switch says.
* An error answers the request when every panel call fails, or when the judge or orchestrator call fails.

A fusion request carries the conversation and nothing else: the panel, the judge, and the orchestrator come from the fusion configuration. A request that sets a generation, routing, or tool control is rejected with `invalid_model_fusion` (400) instead of applying it to one inner call. Remove the listed fields; the panel, judge, orchestrator, and web tools are set on the fusion.

> [tab] Responses API
>
> | Group | Rejected fields |
> | - | - |
> | Sampling and reasoning | `temperature`, `top_p`, `frequency_penalty`, `presence_penalty`, `top_logprobs`, `max_output_tokens`, `reasoning`, `thinking`, `text.verbosity` |
> | Caching, routing, accounting | `cache_control`, `prompt_cache_key`, `prompt_cache_retention`, `prompt_cache_options`, `service_tier`, `fallbacks`, `load_balancer`, `retry`, `timeout` |
> | Tools and input content | `tools`, `tool_choice`, `parallel_tool_calls`, `max_tool_calls`, and in `input`: a tool result item or a content part other than text |
> | Output shape | A JSON schema in `text.format`, `include`, `truncation` other than `auto`, `stream_options` |
> | Conversation and request shape | `previous_response_id`, `conversation`, `memory`, `template_engine`, `variables`, `background`, `safety_identifier`, `user`, `integration_id`, `limits`, `context_management`, `moderation`, `prompt` |

> [tab] Chat completions
>
> | Group | Rejected fields |
> | - | - |
> | Sampling and reasoning | `temperature`, `top_p`, `top_k`, `n`, `max_tokens`, `max_completion_tokens`, `frequency_penalty`, `presence_penalty`, `seed`, `logprobs`, `top_logprobs`, `stop`, `reasoning_effort`, `verbosity`, `thinking` |
> | Caching, routing, accounting | `cache_control`, `prompt_cache_key`, `service_tier`, `store: true`, `fallbacks`, `load_balancer`, `retry`, `timeout` |
> | Tools and message content | `tools`, `tool_choice`, `parallel_tool_calls`, `max_tool_calls`, and in `messages`: a `role: tool` message, `tool_calls`, `tool_call_id`, audio content, or a content part other than `text` and `input_text` |
> | Output shape | `response_format` other than `text`, the `audio` parameter, a non-text entry in `modalities` |

## Cost

One fusion request makes several model calls: one per panel model, one judge call, plus at most one repair attempt when its analysis fails validation, and in **Analysis** mode one orchestrator call. Each call pays its own prompt.

* A panel call carries the request plus a fixed panel prompt.
* The judge call carries the request plus **every** panel answer, so its input grows with panel size and answer length, not only with the request.
* The orchestrator call carries the request, the judge's structured analysis, and the raw panel answers when **Include raw panel answers** is on.

Usage and cost on the fusion response add up every inner call. Billing follows the inner calls; the aggregate is not charged again.

Traces shows the run as three phases, `panel`, `judge`, and `synthesis`, each with a span per model call carrying that call's tokens and cost.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.