Skip to content

Apex — Forge Integration

How Forge (cmmd-forge) calls Apex endpoints via the apex provider.

Status: draft. Wiring not yet in Forge code as of 2026-05-19. This page describes the intended integration. Tracked in FORGE-20.

Forge’s apex provider is at apps/server/src/provider/Layers/ApexProvider.ts. The provider routes through the Claude Agent SDK — each profile in DEFAULT_APEX_PROFILES (defined in packages/contracts/src/settings.ts:215) carries its own Anthropic-compatible base URL + API key.

This pattern is already in place; we just add new profiles for our local Apex endpoints.

packages/contracts/src/settings.ts
export const DEFAULT_APEX_PROFILES: ReadonlyArray<ClaudeEndpointProfile> = [
// ... existing profiles (apex-flash, apex-general, apex-reason, apex-core) ...
// NEW: local apex tier (Sentinel)
{
slug: "apex-core-local",
displayName: "Apex Core (Local)",
description: "Local production model on Sentinel.",
apiModelId: "apex-core",
baseUrl: "https://apex-api.cmmd.ai",
apiKey: "", // env: APEX_API_KEY
disableToolSearch: false,
},
// NEW: lab tier (Ryzen)
{
slug: "lab-flash",
displayName: "Lab Flash",
description: "Fast multimodal — experimental tier.",
apiModelId: "lab-flash",
baseUrl: "https://lab-apex-api.cmmd.ai",
apiKey: "", // env: APEX_API_KEY (same key)
disableToolSearch: false,
},
{
slug: "lab-general",
displayName: "Lab General",
description: "Experimental workhorse model.",
apiModelId: "lab-general",
baseUrl: "https://lab-apex-api.cmmd.ai",
apiKey: "",
disableToolSearch: false,
},
];

The Forge ApexProvider.ts checkApexProviderStatus() function already resolves env-based keys via resolveApexApiKey() — no additional plumbing needed.

Terminal window
APEX_API_KEY=<master_key>

Single env var serves both endpoints (same key on both proxies).

In Forge Settings → Providers, the CMMD card (powered by provider: apex) will list:

  • Apex Core (Local) — apex-core-local
  • Lab Flash — lab-flash
  • Lab General — lab-general

…alongside the existing apex-flash/apex-general/apex-reason/apex-core cloud-backed profiles.

Per architecture-cmmd-card-apex-provider-mapping: the visible “CMMD” card maps to the apex provider key, not the cmmd key. Changes to provider behavior need to touch BOTH ApexProvider.ts and CMMDProvider.ts.