Routing / Policy control

Route by policy, not model names

Policyauto_balanced
Modelclaude-sonnet
Fallbackready
Traceindexed
Live route preview
Completed
POST /v1/chat/completionsSummarize support incident log
auto:balanced
01
Policy matchteam_default / no exception
pass
02
Model selectedquality target inside $0.020 cap
Sonnet
03
Fallback readygpt-4o-mini -> deepseek-v3
0 used
04
Trace indexedreq_8f3k2m9x1p
done
Why this route?

Balanced policy chose quality within the request cap, then wrote the decision into the trace.

Team defaultAuto · Balanced · applies to all API keys

Default for every key unless an exception matches.

Saved
Auto · BalancedBlend cost and quality conservatively.

Selected for mixed production traffic.

Auto · Cost-firstFavor savings for high-volume work.
Auto · Quality-firstUse stronger models when risk is high.
Cost vs quality preference
P20
Custom exceptionRequest includes tools · task type is translation · complexity is complex

Exceptions override the default only when conditions match.

auto:quality
Preview routingSummarize support incident log
selected modelclaude-sonnet

Preview shows the route before teams save policy changes.

Console policy

Tune the policy once, then keep application code stable.

Admins set the team default, add exceptions only when needed, and preview the route before saving.

Routing console
Team policy
Team defaultAuto · Balanced · applies to all API keys

Default for every key unless an exception matches.

Saved
Auto / BalancedBlend cost and quality conservatively.

Selected for mixed production traffic.

Auto / Cost-firstFavor savings for high-volume work.
Auto / Quality-firstUse stronger models when risk is high.
Cost vs quality preference
P20
Custom exceptionRequest includes tools · task type is translation · complexity is complex

Exceptions override the default only when conditions match.

auto:quality
Scenario

A support request shows how policy replaces model names.

The app sends one stable request. LineMod evaluates policy, chooses a model, prepares fallback, and records the decision.

App requestSummarize a support incident log
{
  "model": "auto:balanced",
  "metadata": {
    "workload": "support",
    "budget_cap": "$0.020"
  }
}
01
Policy match

Team default applies because no exception matched.

02
Model selected

Sonnet fits the quality target and budget cap.

03
Fallback ready

Backup chain is prepared but not used.

Decision receipt
Policyauto_balanced
Selected modelclaude-sonnet
Fallbackready / 0 used
Tracereq_8f3k2m9x1p
Developer handoff

Application code stays stable while routing policy changes.

Teams can tune model choice in the console without redeploying product code.

client = OpenAI({
  baseURL: "https://api.linemod.ai/v1",
  apiKey: process.env.LINEMOD_API_KEY
})

client.chat.completions.create({
  model: "auto:balanced",
  messages,
  metadata: { policy: "team_default" }
})
Why it mattersNo provider lock-in in application code.

Routing changes live in LineMod policy, while developers keep the same SDK workflow.

Put routing policy between apps and models

Start with one API route, then tune cost, quality, and fallback from the gateway.

Request access