Skip to content

Claude provider model list should support gateway/custom models #910

Description

@ttxslol

Problem

When using CloudCLI with Claude Code configured for a custom Anthropic-compatible gateway, the Claude provider model list in CloudCLI still returns only the hardcoded fallback Claude models.

This means custom gateway models cannot be selected from /models, even though Claude Code itself can be configured to use the gateway via environment variables.

Environment

  • CloudCLI: 1.34.0
  • Claude Code: 2.1.176
  • Self-hosted CloudCLI
  • Claude provider authenticated via API token / custom gateway
  • Gateway exposes /v1/models and /v1/messages

Claude Code environment is configured with variables like:

ANTHROPIC_BASE_URL=http://127.0.0.1:8080
ANTHROPIC_AUTH_TOKEN=...
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

The gateway /v1/models returns custom model IDs such as:

gpt-5.3-codex
gpt-5.4-mini
codex-auto-review

Current Behavior

CloudCLI's endpoint:

GET /api/providers/claude/models

returns only the static Claude fallback models, for example:

default
fable
sonnet
sonnet[1m]
opus[1m]
haiku

As a result, /models in the CloudCLI chat UI cannot select gateway-provided custom model IDs.

Expected Behavior

CloudCLI should provide a supported way to include gateway/custom model IDs in the Claude provider model list.

Possible approaches:

  1. Re-enable safe dynamic model discovery when Claude Code gateway model discovery is enabled, without creating unwanted side-session/jsonl artifacts.
  2. Add explicit environment-variable configuration, for example:
CLOUDCLI_CLAUDE_MODELS=gpt-5.3-codex,gpt-5.4-mini,codex-auto-review
CLOUDCLI_CLAUDE_DEFAULT_MODEL=gpt-5.3-codex
  1. Add a settings UI field for custom Claude provider model IDs.

Related Context

This appears related to PR #806, which intentionally disabled runtime supportedModels() discovery and always serves a static fallback list.

It is also adjacent to #234 and #132, but those discuss proxy/custom endpoint integration more broadly. This issue is specifically about the Claude provider /models list not exposing gateway/custom model IDs.

Workaround

I was able to work around this locally by patching dist-server/server/modules/providers/list/claude/claude-models.provider.js to append the custom gateway model IDs to CLAUDE_FALLBACK_MODELS.OPTIONS, but that is fragile and will be overwritten on upgrade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions