Model Fusion
Send one prompt to several models at once, and optionally merge them into a single answer.
POST/v1/fusion
Model Fusion is a Pleum-native endpoint. It does not follow the OpenAI or Anthropic SDK shape, so call /v1/fusion directly. It fans one prompt out to 2–4 models in parallel, and when fuse is true it synthesizes the successful answers into one merged answer. Authenticate by passing your plm_ key as a Bearer token.
Request body#
| Parameter | Type | Required | Description |
|---|---|---|---|
| models | string[] | Required | Array of 2–4 model IDs. Duplicates are removed; fewer than 2 distinct models returns 400. |
| messages | array | Required | Same {role, content} array as chat. Multimodal input is supported. |
| temperature | number | Optional | Default 0.7. |
| max_tokens | integer | Optional | Default 2048. |
| fuse | boolean | Optional | If true and at least 2 sources succeed, synthesizes a merged answer. Default true. |
| fuse_model | string | null | Optional | Model ID used for synthesis. Default null, which uses the first successful source's model. |
request
curl https://apirouter.pleum.ai/v1/fusion \
-H "Authorization: Bearer $PLEUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"models": ["gpt-4o", "claude-sonnet-4-6"],
"messages": [
{"role": "user", "content": "Explain the CAP theorem in one paragraph."}
],
"temperature": 0.7,
"max_tokens": 2048,
"fuse": true
}'HTTP (Python)
import requests
resp = requests.post(
"https://apirouter.pleum.ai/v1/fusion",
headers={
"Authorization": "Bearer plm_...",
"Content-Type": "application/json",
},
json={
"models": ["gpt-4o", "claude-sonnet-4-6"],
"messages": [{"role": "user", "content": "Explain the CAP theorem in one paragraph."}],
"temperature": 0.7,
"max_tokens": 2048,
"fuse": True,
},
)
print(resp.json()["text"])HTTP (TypeScript)
const res = await fetch("https://apirouter.pleum.ai/v1/fusion", {
method: "POST",
headers: {
Authorization: "Bearer plm_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
models: ["gpt-4o", "claude-sonnet-4-6"],
messages: [{ role: "user", content: "Explain the CAP theorem in one paragraph." }],
temperature: 0.7,
max_tokens: 2048,
fuse: true,
}),
});
const data = await res.json();
console.log(data.text);Response#
sources holds each model's result (model, provider, text, cost_krw, latency_ms, error). When synthesis runs, fused_text and the model used for it (fused_by) are returned, and total_cost_krw is the sum of every source call plus the fuse step.
200 OK
{
"sources": [
{
"model": "gpt-4o",
"provider": "openai",
"text": "The CAP theorem states that a distributed system...",
"cost_krw": 3,
"latency_ms": 912,
"error": null
},
{
"model": "claude-sonnet-4-6",
"provider": "anthropic",
"text": "In any distributed data store, you can guarantee...",
"cost_krw": 4,
"latency_ms": 1180,
"error": null
}
],
"fused_text": "The CAP theorem says a distributed system can provide at most two of consistency, availability, and partition tolerance...",
"fused_by": "gpt-4o",
"total_cost_krw": 9
}Each source call bills real credits, and the fuse step bills again on its own —
total_cost_krw is the sum of all of them. Partial failures are isolated: a failed source returns with its error set, and the call still returns 200. The fuse step runs only when fuse is true and at least 2 sources succeed.