diegosouzapw/OmniRoute · error
PAID_MODEL_TARGET_BLOCKED
PAID_MODEL_TARGET_BLOCKED
Error message
This field cannot target a paid-only model while 'Hide paid models' is enabled.
What it means
Business-rule rejection on the background-degradation settings route (#6540): the submitted degradationMap maps a field to a model positively identified as paid-only in the catalog while hidePaidModels is enabled. The route blocks the write with PAID_MODEL_TARGET_BLOCKED (fails open on unknown names).
Solutions
- Choose a free-tier degradation target model
- Disable 'Hide paid models' in settings if paid targets are intended
- Verify the model name/alias resolves to the tier you expect
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/app/api/settings/background-degradation/route.ts:79 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/2cdc94e760473ad6.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/api/settings/background-degradation/route.ts:79
details: [{ field: "body", message: "Invalid JSON body" }],
},
},
{ status: 400 }
);
}
try {
const validation = validateBody(jsonObjectSchema, rawBody);
if (isValidationFailure(validation)) {
return NextResponse.json({ error: validation.error }, { status: 400 });
}
const config = validation.data as { degradationMap?: Record<string, string> };
if (await hasBlockedPaidTarget(config.degradationMap)) {
return NextResponse.json(
{
error: {
code: "PAID_MODEL_TARGET_BLOCKED",
message:
"This field cannot target a paid-only model while 'Hide paid models' is enabled.",
},
},
{ status: 400 }
);
}
setBackgroundDegradationConfig(config);
// Persist to database (excluding stats)
const { stats, ...persistable } = getBackgroundDegradationConfig();
await updateSettings({ backgroundDegradation: persistable });
return NextResponse.json({ success: true, ...getBackgroundDegradationConfig() });
} catch (error) {
console.error("[API ERROR] /api/settings/background-degradation PUT:", error);
return NextResponse.json({ error: "Failed to update config" }, { status: 500 });View on GitHub (pinned to a179ffed5b)