unslothai/unsloth · error · HTTPException

ChatGPT subscription routing is fixed.

Error message

ChatGPT subscription routing is fixed.

What it means

A 400 from _validate_provider_auth_contract: for a chatgpt_oauth provider, a base_url was supplied that is either non-null on create, or different from the stored one on update. ChatGPT subscription traffic is routed through fixed OpenAI endpoints, so the base URL is not user-configurable.

Source

Thrown at studio/backend/routes/providers.py:110

        updated_at = row["updated_at"],
    )


def _validate_provider_auth_contract(
    info: dict,
    *,
    encrypted_api_key: str | None,
    base_url: str | None,
    models: list[str] | None,
    updating: bool,
    clear_api_key: bool = False,
) -> None:
    if info.get("auth_kind") != "chatgpt_oauth":
        return
    if encrypted_api_key or clear_api_key:
        raise HTTPException(status_code = 400, detail = "ChatGPT subscriptions do not use API keys.")
    if base_url is not None and (not updating or base_url != info["base_url"]):
        raise HTTPException(status_code = 400, detail = "ChatGPT subscription routing is fixed.")
    if models is not None and (not models or not set(models).issubset(set(info["default_models"]))):
        raise HTTPException(status_code = 400, detail = "Choose only curated Codex models.")


def _validate_max_output_tokens_contract(
    provider_type: str,
    field_was_set: bool,
    value: Optional[int] = None,
) -> None:
    """Reject a non-null override on a provider type with its own documented caps.

    An explicit null is allowed through everywhere: the dialog shows the field for rows
    it displays as Custom but the backend stores as `openai`, and a blank field
    serialises as null, so rejecting it failed every unrelated edit of those rows.
    Clearing an override that cannot exist is a no-op.
    """
    if field_was_set and value is not None and provider_type != "custom":
        raise HTTPException(

View on GitHub (pinned to 203007d190)

Solutions

  1. Omit base_url when creating or updating ChatGPT subscription providers.
  2. On update, echo the stored base_url unchanged (the update path explicitly allows re-sending the same value).
  3. To route via a custom gateway, use a custom/API-key provider type instead.
Defensive patterns

Strategy: validation

Validate before calling

if (info.auth_kind === "chatgpt_oauth") {
  if (creating && body.base_url != null) delete body.base_url;
  if (updating && body.base_url !== info.base_url) body.base_url = info.base_url; // echo stored value
}

Prevention

When it happens

Trigger: POST creating a ChatGPT subscription provider with a base_url in the body; PUT sending a base_url that differs from info['base_url']; an edit dialog that round-trips a modified base URL for all provider rows.

Common situations: Generic provider dialog used for every row; users attempting to proxy ChatGPT through a gateway; sync tooling that copies base_url between provider configs.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/c0e10708baa5a77a. Report an issue: GitHub.