Effort
One optional knob biases any call toward latency, cost, or quality — no model swap and no code rewrite.
Setting effort
Section titled “Setting effort”The preferred form is the X-DI-Effort header, which you can set once on the client so it applies to every request. A ?effort= query parameter works too.
client = OpenAI( api_key="llm_live_...", base_url="https://api.directinference.com/di/v1", default_headers={"X-DI-Effort": "high"},)const client = new OpenAI({ apiKey: "llm_live_...", baseURL: "https://api.directinference.com/di/v1", defaultHeaders: { "X-DI-Effort": "high" },});curl https://api.directinference.com/di/v1/chat/completions \ -H "Authorization: Bearer llm_live_..." \ -H "X-DI-Effort: high" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5-mini", "messages": [{ "role": "user", "content": "..." }] }'
# or, without a custom header:# POST .../di/v1/chat/completions?effort=highecho '{ "model": "gpt-5.5-mini", "messages": [{ "role": "user", "content": "..." }] }' \ | https POST api.directinference.com/di/v1/chat/completions \ Authorization:'Bearer llm_live_...' \ X-DI-Effort:high \ Content-Type:application/json
# or, without a custom header:# https POST 'api.directinference.com/di/v1/chat/completions?effort=high'client := openai.NewClient( option.WithAPIKey("llm_live_..."), option.WithBaseURL("https://api.directinference.com/di/v1"), option.WithHeader("X-DI-Effort", "high"),)Levels
Section titled “Levels”Lower levels bias toward cost and latency; higher levels bias toward quality — model order, retries, and repair budget. Effort tunes the chosen request type; it does not pick the type. Higher effort generally means more reasoning before the answer — see Reasoning output for how it appears in responses. Prefer a model id over a header? The catalog also lists di-saver and di-max — the same model with effort pinned — for model pickers and fast/smart slots (Listing models).
fast → minimal → low → medium → high → xhigh → max
cheaper / faster → higher quality
| Level | Bias |
|---|---|
auto | Inferred from model intent and use case (the default). |
fast | Lowest latency and cost; can keep simple work on cheaper models. |
none | Alias for fast — OpenAI’s “disable reasoning” value, accepted anywhere fast is. |
minimal | Minimal spend; trims optional steps. |
low | Leans cheaper and faster. |
medium | Balanced cost and quality. |
high | Leans toward quality — model order and retries. |
xhigh | Stronger quality bias; more repair budget. |
max | Maximum quality bias regardless of cost. |
Where effort comes from
Section titled “Where effort comes from”If several effort signals are present, the first one found wins, in this order:
- X-DI-Effort request header
- ?effort= query parameter
- OpenAI reasoning.effort or reasoning_effort
- Gemini thinking config
- Anthropic thinking.budget_tokens
- Model suffix, e.g. claude-sonnet-4-6@xhigh or gpt-5:fast
- Auto inference from model intent and use case
Native reasoning controls
Section titled “Native reasoning controls”Already set a provider’s reasoning or thinking control? DI reads it as the effort signal — no X-DI-Effort needed. OpenAI reasoning_effort / reasoning.effort and Gemini thinkingConfig.thinkingLevel are used as the effort level directly (none → fast). Token budgets map to the nearest band:
Gemini thinkingBudget | Effort |
|---|---|
0 | fast |
| 1 – 2,048 | minimal |
| 2,049 – 8,192 | low |
| 8,193 – 16,384 | medium |
| 16,385 – 32,768 | high |
| 32,769 – 65,536 | xhigh |
| 65,537+ | max |
Anthropic budget_tokens | Effort |
|---|---|
| disabled or ≤ 0 | auto |
| 1 – 4,096 | low |
| 4,097 – 8,192 | medium |
| 8,193 – 16,384 | high |
| 16,385 – 32,768 | xhigh |
| 32,769+ | max |