Multi-Model Fusion
ORVEXA Fusion allows you to call multiple models simultaneously with a single request and receive either the fastest response or an aggregated result.
First-Response Mode
Sends the request to all specified models and returns the first response received, minimizing latency.
Aggregate Mode
Collects responses from all models and returns them together, useful for comparison and ensemble approaches.
How It Works
Pass a comma-separated list of model IDs and set the X-Orvexa-Fusion header to the desired mode.
The X-Orvexa-Fusion Header
X-Orvexa-Fusionfirst — Returns the fastest model's response. Ideal for latency-sensitive applications where speed matters more than model choice.
aggregate — Returns all model responses in a single payload. Each response is labeled with its source model for comparison or ensembling.
Model List: Pass multiple model IDs as a comma-separated string in the model field, e.g., "deepseek-chat,deepseek-reasoner".
First-Response Example
This request sends the prompt to both DeepSeek Chat and DeepSeek Reasoner, returning whichever responds first.
curl https://api.orvexaproject.com/v1/chat/completions \
-H "Authorization: Bearer nx-sk-dcfab6de7407c3c5f74fb627" \
-H "Content-Type: application/json" \
-H "X-Orvexa-Fusion: first" \
-d '{
"model": "deepseek-chat,deepseek-reasoner",
"messages": [
{"role": "user", "content": "What is 2 + 2?"}
]
}'Aggregate Example
This request collects responses from both models and returns them in the fusion.responses array.
curl https://api.orvexaproject.com/v1/chat/completions \
-H "Authorization: Bearer nx-sk-dcfab6de7407c3c5f74fb627" \
-H "Content-Type: application/json" \
-H "X-Orvexa-Fusion: aggregate" \
-d '{
"model": "deepseek-chat,deepseek-reasoner",
"messages": [
{"role": "user", "content": "Summarize the benefits of exercise."}
]
}'Python SDK Example
from openai import OpenAI
client = OpenAI(
api_key="nx-sk-dcfab6de7407c3c5f74fb627",
base_url="https://api.orvexaproject.com/v1",
)
# Pass a comma-separated list of model IDs.
response = client.chat.completions.create(
model="deepseek-chat,deepseek-reasoner",
messages=[{"role": "user", "content": "What is 2 + 2?"}],
extra_headers={
"X-Orvexa-Fusion": "first"
},
)
# In "first" mode, the fastest model's response is returned.
print(response.choices[0].message.content)Aggregate Response
In aggregate mode, the response includes a fusion object containing per-model latency data and all generated outputs.
{
"id": "fusion-abc123",
"object": "chat.completion",
"model": "fusion:aggregate",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "DeepSeek Chat: Exercise improves cardiovascular health...\n\nDeepSeek Reasoner: The three main benefits are: 1) cardiovascular..."
},
"finish_reason": "stop"
}
],
"fusion": {
"mode": "aggregate",
"models": ["deepseek-chat", "deepseek-reasoner"],
"responses": [
{ "model": "deepseek-chat", "latency_ms": 320 },
{ "model": "deepseek-reasoner", "latency_ms": 1850 }
]
}
}