For the complete documentation index, see llms.txt. A markdown version of this page is at /guides/connect-llm-gateway/index.md.

Connect a coding agent to an LLM gateway

Point the coding agents on your labeled workstations at your LLM gateway, with the gateway key stored as a Secret.

Point the coding agents on your labeled workstations at your LLM gateway, with the gateway key stored as a Secret. You want this when your team sends model requests through a gateway such as OpenRouter. Then you don’t set up each agent by hand. The steps work for any of the supported agents that an LLM Integration configures. The examples use Claude Code, which is only an example.

Prerequisites

  • Install Ringleader, with the Ringleader application running.
  • An account with an LLM gateway, and its key. The examples use OpenRouter.
  • A namespace to work in. The examples use acme.
  • A label that selects the workstations to connect. The examples use team: platform. Selectors describes how labels select.
  • A running workstation in that namespace. The examples use a workstation named my-agent-box; replace it with yours. To create one, follow the Quickstart and use your own name. Then run rl workstation label my-agent-box team=platform -n acme. Ringleader applies the configurations that select it on the workstation’s next configuration pass.

Store the gateway key as a Secret

Run rl secret create with the key. The Secret stays in your namespace, and Ringleader masks its value wherever it shows it:

rl secret create openrouter -n acme --from-string token=<your-openrouter-key>

Imperative creation commands lists every option of the command.

Add a coding agent to the workstations

A devtool in a WorkstationConfig installs a coding agent. The same label selects the workstations that get it.

To install your agent, declare its devtool: claude-code, codex, opencode or pi. An LLM Integration configures none of the other two agents, Cursor CLI and Antigravity CLI. This example installs Claude Code. Supported agents says what each devtool gives you, and Coding agent setup says how to start each agent.

  1. Save this file as claude-code.yaml. Change team: platform to your label, and acme to your namespace:

    apiVersion: workstations.ringleader.dev/v1
    kind: WorkstationConfig
    metadata:
      name: claude-code
      namespace: acme
    spec:
      selector:
        matchLabels:
          team: platform
      devtools:
        - name: claude-code               # the example agent: use your agent's devtool
  2. Run rl apply -f claude-code.yaml. Ringleader then installs Claude Code on every workstation labeled team: platform.

Apply an Integration for the gateway

An Integration holds the gateway’s address and a reference to the Secret.

  1. Save this file as llm.yaml. Change team: platform to your label, and acme to your namespace:

    apiVersion: workstations.ringleader.dev/v1
    kind: Integration
    metadata:
      name: llm
      namespace: acme
    spec:
      type: llm
      selector:
        matchLabels:
          team: platform
      llm:
        endpoint:
          source: external
          vendor: openrouter            # picks the URL and the protocol
          credentialRef:
            name: openrouter            # a Secret in this namespace
            key: token
  2. Run rl apply -f llm.yaml. Ringleader then points the agents it configures on every workstation labeled team: platform at the gateway.

With source: external, Ringleader delivers the key to each of those workstations. Secrets on the workstation says what that exposes. To keep the key off the workstations, follow Keep the gateway key off the workstation instead.

You write no base URL, no placeholder key and no agent settings, because vendor selects them. The Integration reference lists every field and every vendor.

An Integration does not configure every agent. Cursor CLI and Antigravity get nothing from it. With vendor: custom it configures Claude Code only. Codex, pi and OpenCode depend on the vendor and on model. Supported agents says what each agent gets. For an agent it does not configure, follow Run your own coding agent in Ringleader.

Optional: Choose the model for other agents

Claude Code needs no model. Codex, pi and OpenCode use the model you name. To choose one, add model: anthropic/claude-sonnet-4.5 under endpoint in llm.yaml, which is an OpenRouter model name. Use your gateway’s own name for the model. Then run rl apply -f llm.yaml again. The pi and OpenCode providers says when those two get a provider.

Check what the Integration put on a workstation

Read the generated configuration that Ringleader built from the Integration, then the endpoint file on the workstation.

  1. On your computer, run rl integration get llm -n acme -o yaml. status.generatedConfig names the configuration.
  2. Run rl workstationconfig get integration-llm -n acme -o yaml. The output is the configuration.
  3. Open a new shell on the workstation with rl shell my-agent-box -n acme. A shell that was already open keeps the environment it started with.
  4. In that shell, run cat /etc/ringleader/integrations/llm.json. The file lists the names of the environment variables the Integration sets, such as ANTHROPIC_BASE_URL, and never their values.

The endpoint files describes what each file carries.

Troubleshoot

  • If a workstation has no endpoint file, check that its labels match the Integration’s matchLabels, as Integration reach describes. If they match, check that its owner can read the Secret. The warning in LLM gateways for coding agents says how to give access.
  • If a variable still has its old value in a terminal, that shell is older than the Integration. Open a new shell.
  • If rl apply refuses the Integration because of the model, your organization’s policy limits which models you can name, as Policy and OrgPolicy describes. Choose a model the policy allows.

Next steps