Problem
Third-party clients (mobile apps, CLI wrappers, etc.) that connect to CloudCLI need to display provider and model selection UI. Currently, the only way to get model data is:
- The
/model command via /api/commands/execute — but it only returns model values (no labels), is missing Gemini, and doesn't return default models.
- Hardcoding the same data from
shared/modelConstants.js — which goes out of sync on every CloudCLI update.
The WebUI doesn't have this problem because it bundles shared/modelConstants.js at build time. External clients don't have that luxury.
Proposed Solution
Add a GET /api/providers/models endpoint that returns the PROVIDERS registry already defined in shared/modelConstants.js:
// In server/modules/providers/provider.routes.ts (or server/routes/)
import { PROVIDERS } from '../../shared/modelConstants.js';
router.get('/models', authenticateToken, (req, res) => {
res.json({ success: true, data: PROVIDERS });
});
Expected Response
{
"success": true,
"data": [
{
"id": "claude",
"name": "Anthropic",
"models": {
"OPTIONS": [
{ "value": "opus", "label": "Opus" },
{ "value": "sonnet", "label": "Sonnet" },
{ "value": "haiku", "label": "Haiku" }
],
"DEFAULT": "opus"
}
},
{
"id": "codex",
"name": "OpenAI",
"models": {
"OPTIONS": [...],
"DEFAULT": "gpt-5.4"
}
},
{
"id": "gemini",
"name": "Google",
"models": {
"OPTIONS": [...],
"DEFAULT": "gemini-3.1-pro-preview"
}
},
{
"id": "cursor",
"name": "Cursor",
"models": {
"OPTIONS": [...],
"DEFAULT": "gpt-5.3-codex"
}
}
]
}
Why This Matters
Without this endpoint, every external client must duplicate and manually maintain the model list from shared/modelConstants.js. When CloudCLI adds or removes models, all clients break silently — for example, a client might assume the default Claude model is "sonnet" while the backend defaults to "opus", causing model selection to be silently ignored.
Implementation Notes
- The data already exists in
shared/modelConstants.js as the PROVIDERS export — this is just exposing it via HTTP.
- Should be ~5 lines of code.
- Consistent with the existing
/api/providers/:provider/auth/status pattern.
Problem
Third-party clients (mobile apps, CLI wrappers, etc.) that connect to CloudCLI need to display provider and model selection UI. Currently, the only way to get model data is:
/modelcommand via/api/commands/execute— but it only returns model values (no labels), is missing Gemini, and doesn't return default models.shared/modelConstants.js— which goes out of sync on every CloudCLI update.The WebUI doesn't have this problem because it bundles
shared/modelConstants.jsat build time. External clients don't have that luxury.Proposed Solution
Add a
GET /api/providers/modelsendpoint that returns thePROVIDERSregistry already defined inshared/modelConstants.js:Expected Response
{ "success": true, "data": [ { "id": "claude", "name": "Anthropic", "models": { "OPTIONS": [ { "value": "opus", "label": "Opus" }, { "value": "sonnet", "label": "Sonnet" }, { "value": "haiku", "label": "Haiku" } ], "DEFAULT": "opus" } }, { "id": "codex", "name": "OpenAI", "models": { "OPTIONS": [...], "DEFAULT": "gpt-5.4" } }, { "id": "gemini", "name": "Google", "models": { "OPTIONS": [...], "DEFAULT": "gemini-3.1-pro-preview" } }, { "id": "cursor", "name": "Cursor", "models": { "OPTIONS": [...], "DEFAULT": "gpt-5.3-codex" } } ] }Why This Matters
Without this endpoint, every external client must duplicate and manually maintain the model list from
shared/modelConstants.js. When CloudCLI adds or removes models, all clients break silently — for example, a client might assume the default Claude model is "sonnet" while the backend defaults to "opus", causing model selection to be silently ignored.Implementation Notes
shared/modelConstants.jsas thePROVIDERSexport — this is just exposing it via HTTP./api/providers/:provider/auth/statuspattern.