Passer au contenu principal
CodeRelayHub

← Retour au digest d’ingénierie

One Endpoint for Your VS Code Coding Assistants

A VS Code workspace can accumulate several AI connections: a terminal agent, an editor extension, a review script, and a second assistant for difficult changes. Each connection brings credentials, model settings, and another place to debug failures. CodeRelay Hub provides a pay-as-you-go endpoint for these workflows. The useful goal is one routing destination, not one configuration file: each client still needs settings that match its protocol.

1. Inventory clients before changing settings

List every assistant you actually use, including tools launched in VS Code’s integrated terminal. Record its authentication method, configuration location, model setting, and supported provider protocols. Include repository scripts that call an OpenAI SDK; they are easy to overlook.

  • Editor extensions: Check whether they support a custom API base and user-supplied credentials.
  • Terminal agents: Treat Claude Code, Codex, and Gemini CLI as separate clients with separate configuration requirements.
  • Local scripts: Find hard-coded provider URLs and environment variables before replacing anything.

An extension tied exclusively to its vendor’s hosted service may not accept an external endpoint. Keep that exception explicit rather than assuming every assistant can be redirected.

2. Separate the endpoint from the protocol

The API base is https://api.coderelayhub.com. However, a shared host does not make Anthropic, OpenAI, and Gemini request formats interchangeable. Use the hub’s current integration instructions to identify the correct base path and compatibility mode for each client.

Do not automatically append /v1 everywhere. Some clients add resource paths themselves; others expect a versioned base URL. A doubled path can look like an authentication or model problem when it is actually a routing mistake. Record the exact working base URL for each integration.

3. Establish a safe credential boundary

Store credentials outside the repository, using an operating-system credential store or a local environment file excluded from version control. An environment file is not loaded automatically by every tool, so verify how each client receives its settings.

For shell-based workflows, define an internal convention such as CODERELAY_API_KEY and CODERELAY_BASE_URL. These are your own variable names, not settings that assistants necessarily recognize. Map them to each client’s documented configuration when launching it. Restart existing terminal sessions when necessary, and never print the key to confirm that it loaded.

4. Connect one client at a time

Start with the client whose custom-provider support is clearest. For Codex, configure its supported provider mechanism rather than assuming that changing a generic environment variable is sufficient. For Claude Code, follow the hub’s Claude Code instructions for its expected authentication and protocol. For Gemini CLI, confirm the supported integration mode for your installed version; a Gemini model name alone does not establish compatibility.

For an OpenAI SDK script, explicitly pass the documented compatible base URL and credential to the SDK client. Keep those values outside application logic. This makes the connection easy to inspect without coupling your code to a particular assistant’s configuration format.

5. Pin models and test a harmless request

Select a model deliberately, such as Claude Sonnet 5.5 or Gemini 3.1 Pro, where supported by the chosen integration. Copy the exact API model identifier from the current model listing; display names are not guaranteed to be accepted identifiers.

First ask for a plain-text response without repository access. Then test streaming and a read-only repository task. Finally, test a small, reviewable edit on a temporary branch. Basic text completion does not prove that tool calls, cancellation, or agent permissions work correctly.

6. Make the setup repeatable and observable

Document each client’s working version, configuration location, base URL, and model identifier in a short onboarding checklist. Keep secrets out. When a request fails, inspect the HTTP status, requested model, and sanitized request metadata before changing several settings at once.

A shared endpoint simplifies routing and billing, but it does not unify context windows, tool behavior, or workspace permissions. Review usage after real tasks, set spending controls where available, and retain each assistant’s approval safeguards. CodeRelay Hub also offers referrals that earn 15% of what referred users pay; keep that separate from technical purchasing decisions.

Open a free workspace to try your setup.

Testez sur une vraie tâche : ouvrez un espace de travail et utilisez le crédit d’essai.

S'inscrire