Skip to content

Feature request: add CommandCode as an AI provider #140

Description

@dibakarsutradhar

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions