AI Gateway Developers Setup

Setup

The reporting views require the Enterprise plan. Choose how you want to use Forgebench:

You want toSet upWhat changes
Keep using your Claude, ChatGPT or other coding-tool subscriptionSession reportingYour tool keeps calling its vendor. Forgebench receives session metadata and available usage.
Use models paid for by your workspaceGateway routingModel requests pass through Forgebench, where model permissions, routing and budgets apply.

You can use both. Signing in to Forgebench does not sign you in to Claude or ChatGPT, and session reporting alone does not route model requests through the gateway.

Install the CLI and sign in

  1. Install the CLI

    curl -fsSL https://forgebench.ai/install.sh | bash

    The installer and the release binaries are served from forgebench.ai, so you only need network access to that host. Check the installed version with forgebench --version.

  2. Run setup

    forgebench setup

    Choose browser SSO or enter an API key privately if you need to sign in. Use the arrow keys and Space to select your coding tools, then press Enter. Enter the outcome numbers for Sync coding sessions, Use ForgeBench for model requests, or both. Approve model access in your browser when asked. Setup reuses an existing chat:write key without prompting. Review the changes and approve them. No --gateway flag or separate gateway command is needed.

  3. Check the selected capture options

    Selecting Sync coding sessions installs the local collector. Plain interactive setup does not select native OpenTelemetry capture. Configure it separately if needed; see OpenTelemetry.

  4. Run a session and check the result

    Restart any tool whose settings changed, then run a small task. Open Gateway → Developers → Personal → Activity to find captured sessions. If you enabled routing, check Activity → Routed requests too.

    forgebench setup --status
    forgebench doctor

    Setup completion means the configuration was applied. Reporting is verified only after the server reports uploads for that tool. A successful gateway inference test does not prove the coding tool loaded its settings.

Release channels

Use the hosted installer for your environment. It selects the release channel and downloads through the matching Forgebench site. Run setup against the matching API URL. Check forgebench --version and each command's --help before onboarding. If a command is missing, check the release notes and update your installation before using it.

EnvironmentInstaller hostDefault channelSetup API
Productionhttps://forgebench.aiStablehttps://api.forgebench.ai
Devhttps://dev.forgebench.aiPreviewhttps://api.dev.forgebench.ai
Staginghttps://staging.forgebench.aiPreviewhttps://api.staging.forgebench.ai

For dev, install with:

curl -fsSL https://dev.forgebench.ai/install.sh | bash
forgebench setup --url https://api.dev.forgebench.ai

For staging, replace dev.forgebench.ai with staging.forgebench.ai. Explicit installer environment variables can override these defaults. For a local or self-hosted API, pass its URL with forgebench setup --url https://your-api.example.com.

ChannelUse
StableThe default for onboarding. Run forgebench update --install to update an official binary installation.
PreviewOpt-in builds for testing changes before the next stable release.

To opt in to preview on an official binary installation:

forgebench update --channel preview --install
forgebench setup

Source and package-manager installations must be updated through the method that installed them. See Update for release checks and installation options.

Your own subscription: capture with OpenTelemetry

Keep your subscription sign-in in the official coding tool. Forgebench uses its own reporting login to receive sessions; it does not need your vendor password or a provider API key for reporting.

To switch a tool to native usage export manually, use forgebench setup --tool claude_code --capture otel or the same command with --tool codex. Check for capture otel applied and restart the tool. Older sessions can still be uploaded with forgebench run --since 30d --push.

To keep local session context alongside native usage, choose combined capture:

forgebench setup --tool claude_code --capture both
forgebench setup --tool codex --capture both

Run the command for each tool you use. OpenTelemetry supplies usage; session sync adds the available repository, branch and session context. Setup preserves an existing exporter it does not own and respects the workspace capture policy. If it reports a conflict, resolve that before expecting capture to work.

Use --capture otel for native usage export alone, or --capture local for local session sync alone. OpenTelemetry alone can lack repository and branch context needed for task linking or session analysis.

Claude Code traces in Observability

With --capture otel or --capture both, Claude Code also exports its own spans. Each turn then appears under Observability → Tracing as your own trace, visible to you and to workspace admins, and not to other members. Claude Code keeps your subscription sign-in and still calls Anthropic directly; Forgebench adds no gateway charge, and spans never add usage or spend (usage still comes from the usage logs, counted once).

A trace reads like any other trace. Its input is your prompt. Each model request shows the model, timing and token usage (input, output and cache), with zero cost, because your subscription paid for it. Each tool call shows its command, file path or arguments as input and what the tool returned as output. Secrets are removed before anything is stored, and personal data is masked when the workspace's redaction policy asks for it.

Claude Code exports the model's reply text only in a restricted debug mode. When it does not, a model request's output is a short summary of what came back, and the trace's output summarises the turn: the models, tokens and tools used, and each tool's result.

To confirm receipt, restart Claude Code, send a short test prompt, and open Observability → Tracing after a few seconds. Traces need a Claude Code version with trace export (beta). To keep usage reporting but stop sending traces, run:

forgebench setup --tool claude_code --capture otel --traces off

Run it again with --traces on to resume. Running setup without --traces keeps your current choice; a first-time setup turns traces on. --capture local or --capture off removes the exporter, traces included.

For Cursor, GitHub Copilot, Antigravity and OpenCode, select session sync in setup. Cursor local history has no measured token usage. An administrator can connect Cursor's usage API or configure Cursor Enterprise OpenTelemetry; see Team configuration.

Direct subscription calls remain outside gateway routing and budget enforcement. Reported usage estimates are separate from your subscription bill.

Authorize model requests

Your workspace administrator supplies provider access and assigns your allowed models and budgets. You do not need to supply a personal provider API key when the workspace funds the requests.

In interactive setup, select Use ForgeBench for model requests. Setup reuses a matching chat:write credential or offers browser authorization. Approve access to save the key privately and configure the tool in the same run. If authorization is declined or unavailable, enter a key privately or leave the prompt blank to skip routing. Model credentials are saved separately from reporting sign-in. Ask your administrator for access if no key is available. See Gateway for saved credentials and scripted setup. A reporting credential does not grant model access.

A Forgebench API key: route through the gateway

In guided setup, choose Use ForgeBench for model requests, or run:

forgebench gateway install

Select a compatible tool and authorize a gateway key. Restart the tool, run a small task, then open Activity → Routed requests to confirm it reached Forgebench.

forgebench gateway status
forgebench gateway verify --forgebench-url https://api.forgebench.ai

For self-hosted deployments, use your own API URL. The verify command checks the deployment's routing contract without making a model call. A successful configuration or contract check is not proof that inference succeeded.

Routing a native subscription through the gateway is a separate, deployment- and client-dependent option. Use it only when Setup guide → Advanced: use an existing native subscription confirms support. Ordinary subscription sign-in plus reporting does not require that option.

Connect tasks and review usage

An administrator connects tracker projects and GitHub repositories under Setup → Configuration → Work sources. Ordinary session sync can associate captured sessions with tasks using selected tracker and repository evidence. You do not need to pick a task before every session.

Open Personal → Usage & costs → By task, or Team → Economics → By task if you have access. See Connect work sources for setup, linking and what the figures include.

Choose how sessions are captured

Open Setup guide → Your session capture. If your workspace permits personal overrides, choose a Tool, a Device or all devices, and a Capture mode, then choose Save capture policy. Available modes are Local capture, OpenTelemetry, Local + OpenTelemetry, and Off.

A saved policy waits for the CLI to apply it. Check Device status for the desired and applied revisions, then run forgebench setup --status and forgebench doctor on that machine. Resolve any settings conflict before expecting new data. Off stops additional session capture; gateway request metering and budget enforcement remain active. With combined capture, proven overlaps can be linked, while uncertain overlap stays estimated.

For completed Claude Code or Codex sessions whose managed OpenTelemetry usage is missing or incomplete, run:

forgebench recover-usage --since 3d --tool claude_code
forgebench recover-usage --since 3d --tool codex

Recovery uses available local token counts and respects the server's capture policy. It does not replace usage that already arrived over OpenTelemetry.

Other ways to run setup

SituationCommand
Preview changes without applying themforgebench setup --dry-run
Start the setup questions againforgebench setup --fresh
Connect Forgebench MCP toolsforgebench setup --mcp
Upload history and enable automatic sync for one toolforgebench setup --tool claude_code --sync-now --install-hooks
Sign in on a machine without a local browserforgebench login --key
Turn off automatic syncforgebench setup --uninstall

If capture stays pending, check forgebench setup --status and forgebench doctor. Confirm the account, workspace and capture policy before rerunning setup. Keep your existing tool credentials in place.

OpenCode requires version 2.x for the pinned plugin. Setup can offer opencode upgrade --major with your approval. If the version cannot be read, check the executable path shown by setup and run opencode --version in the same terminal. Multiple installations can leave an older executable first on PATH. A fresh OpenCode installation does not need an existing session database before setup installs the collector.

If you already route through Forgebench, keep your provider and model settings. Select session sync to add reporting. If reporting sign-in has expired or its key was revoked, sign in again; a working inference key cannot replace it.

For flags, exit codes and unattended installs, see the CLI reference.

Install OpenCode without the CLI

The OpenCode plugin does not need the ForgeBench CLI. Sign-in, model routing and session reporting go straight from OpenCode to ForgeBench. This needs OpenCode 2.x. Check it with opencode --version.

OpenCode 2.x is the @opencode/cli package. The older opencode-ai package stops at version 1.19.5 and uses the same opencode command, so remove it first:

npm uninstall -g opencode-ai && npm install -g @opencode/cli

Then use only OpenCode commands:

opencode plugin add @forgebench/opencode
opencode auth login forgebench --method oauth

Restart OpenCode if it asks you to, then pick a ForgeBench model in /models. You can also sign in with /connect in OpenCode. The hosted service needs no options and no edits to opencode.json.

Browser sign-in asks you to approve model access, which asks for your password a second time. It stores two separate keys in OpenCode's own credential store: a model key for /v1/models and model requests, and a reporting key for session, context, trace and task data. The model key must be one an administrator issued to you that has not been used yet. If there is none, ask your administrator for a developer key, or connect with a pasted key.

For the plugin options, see OpenCode plugin entry.

Next

Cookie settings

Our Cookie Policy lists every cookie and what it does.