Problem statement
JobSync's AI features support a fixed set of providers: Ollama, OpenAI, DeepSeek, Gemini, and OpenRouter. There is no way to use CommandCode (https://api.commandcode.ai) even though it exposes an OpenAI-compatible API and serves Claude, GPT, Gemini, and open models behind a single API key. Users who already have a CommandCode key cannot use it in JobSync without standing up an external OpenAI-compatible proxy.
Proposed solution
Register commandcode as an optional cloud provider, following the same path as OpenRouter:
- Add a
commandcode entry to PROVIDER_REGISTRY in src/lib/ai/provider-registry.ts
(cloud / api-key, envVar: COMMANDCODE_API_KEY,
modelsEndpoint: "commandcode/models", parseModelsResponse).
- Add a verifier and a factory in
src/lib/ai/provider-registry.server.ts.
- Add a models route at
src/app/api/ai/commandcode/models/route.ts mirroring
src/app/api/ai/openrouter/models/route.ts.
One CommandCode-specific detail: it answers the Anthropic Messages endpoint for Claude models and OpenAI Chat Completions for everything else, both at https://api.commandcode.ai/provider/v1. So the factory routes claude* model ids through createAnthropic and all others through createOpenAI. A mismatched pairing returns HTTP 400.
This is purely additive — no existing provider changes.
Alternatives considered
Related
Problem statement
JobSync's AI features support a fixed set of providers: Ollama, OpenAI, DeepSeek, Gemini, and OpenRouter. There is no way to use CommandCode (https://api.commandcode.ai) even though it exposes an OpenAI-compatible API and serves Claude, GPT, Gemini, and open models behind a single API key. Users who already have a CommandCode key cannot use it in JobSync without standing up an external OpenAI-compatible proxy.
Proposed solution
Register
commandcodeas an optional cloud provider, following the same path as OpenRouter:commandcodeentry toPROVIDER_REGISTRYinsrc/lib/ai/provider-registry.ts(cloud / api-key,
envVar: COMMANDCODE_API_KEY,modelsEndpoint: "commandcode/models",parseModelsResponse).src/lib/ai/provider-registry.server.ts.src/app/api/ai/commandcode/models/route.tsmirroringsrc/app/api/ai/openrouter/models/route.ts.One CommandCode-specific detail: it answers the Anthropic Messages endpoint for Claude models and OpenAI Chat Completions for everything else, both at
https://api.commandcode.ai/provider/v1. So the factory routesclaude*model ids throughcreateAnthropicand all others throughcreateOpenAI. A mismatched pairing returns HTTP 400.This is purely additive — no existing provider changes.
Alternatives considered
/messagessplit, and is a broader, riskier change than a single registry entry.Related