Agentic Data Plane

rpk ai run claude

Launch Anthropic’s Claude Code CLI with its model traffic routed through the Redpanda AI gateway for the current rpk ai environment.

rpk ai points ANTHROPIC_BASE_URL at the gateway’s Anthropic Messages endpoint for the chosen provider and wires the gateway auth for the life of the session. No token is ever written to disk.

Both auth modes run in your REAL Claude Code config home, so your workspace trust, onboarding, theme, and MCP servers all apply. rpk ai writes nothing into ~/.claude in either mode:

  • managed (API key): the gateway apiKeyHelper (rpk ai auth api-key) prints the stored Agentic Data Plane API key; aigw injects the upstream Anthropic key. The helper is passed via claude --settings as a JSON string, off disk and merged on top of your settings. Your ~/.claude/settings.json remains untouched. An explicitly provided Agentic Data Plane API key uses the process environment instead.

  • passthrough (enterprise/Max subscription): your existing subscription login (stored under your config home) is used. rpk ai only sets the gateway base URL and the X-Redpanda-Api-Key gateway header in the environment; your subscription OAuth flows through aigw to Anthropic untouched.

Pass --claude-config-dir to run against an isolated config home instead of your real one (rpk ai still never writes into it).

Authenticated launches require an Agentic Data Plane API key. Account sign-in credentials serve only provider reads and API-key management; they are never passed to the model client. If key acquisition fails, rpk ai refuses to launch. --api-key=no requires an already provided Agentic Data Plane API key and never uses an account token. Passthrough’s gateway API key stays in the process environment, so Claude Code’s tool subprocesses (Bash, hooks, MCP) inherit it.

Because passthrough uses your real config home, any auth configured in your ~/.claude/settings.json (an apiKeyHelper, or env.ANTHROPIC_AUTH_TOKEN) still applies. It outranks the subscription OAuth aigw needs to relay. The command scrubs only the inherited shell env, not your on-disk settings.

Anthropic, Bedrock, Vertex and Fireworks providers are supported. --passthrough selects subscription authentication for invoke-only Anthropic access. A readable Anthropic provider’s authentication setting takes precedence. Readable Bedrock, Vertex and Fireworks providers reject --passthrough. --bedrock selects native Bedrock mode for invoke-only access. Readable Anthropic and Vertex providers ignore it with a warning. Fireworks providers reject it.

A requested model must belong to any configured provider model allowlist. Fireworks requires a nonempty allowlist. Without -m, Fireworks selects the first compatible configured model. Bedrock and Vertex select the first compatible configured model, or a compatible server-catalog model when unrestricted. Anthropic providers leave model selection to Claude Code when -m is omitted.

Fireworks requires Claude Code 2.1.318 or newer and provider read access. The selected exact configured model must declare direct Messages support for streaming, tools, multi-turn conversations and system prompts in the server catalog. Its ID is used for main, tier, small/fast and subagent calls. Fireworks uses managed gateway authentication only; --passthrough and --bedrock are refused. User/project settings are excluded, and native settings, agent, session and route overrides are refused. Auto permission mode is unsupported. Hosted tool search is disabled. Fireworks count-tokens support is not assumed.

A bedrock provider launches Claude Code in its native Bedrock mode pointed at the same gateway prefix. The gateway signs the upstream call with the provider’s AWS credentials (SigV4), so no AWS keys ever reach your machine. The managed apiKeyHelper auth works exactly as above. Passthrough does not apply, because there is no Bedrock analog of a Claude subscription. Pass -m an Anthropic model or inference-profile ID recognized by the server catalog. Invoke-only --bedrock requires an explicit server-catalog Anthropic model because the provider’s allowlist and region cannot be checked. Claude Code’s background (small/fast) model defaults to a Haiku-class inference profile in Bedrock mode; if the provider’s allowlist doesn’t include it, export ANTHROPIC_SMALL_FAST_MODEL with an allowlisted ID.

A vertex provider launches Claude Code in its native Vertex mode pointed at the same gateway prefix, at the provider’s own project and location. The gateway signs the upstream call with the provider’s service account, so no Google credentials are needed on your machine. Auth works as for bedrock, and passthrough does not apply. Pass -m an Anthropic model ID recognized by the server catalog. rpk ai must read the provider to learn its location, so a vertex provider needs read access, not only invoke access.

Pass Claude Code’s own flags after a literal --:

rpk ai run claude -L anthropic -m MODEL_ID -- --permission-mode plan
rpk ai run claude -L bedrock -m MODEL_ID -- -p "hi"
rpk ai run claude -L vertex -m MODEL_ID -- -p "hi"

Usage

rpk ai run claude [-- CLAUDE_ARGS...] [flags]

Flags

Value Type Description

--api-key

string

authenticate the session with an Agentic Data Plane API key: ask (ask before creating one), yes (create one without asking, also without a terminal), no (do not create a key; require an already provided Agentic Data Plane API key). Default: ask.

--bedrock

bool

Launch Claude Code in its native Bedrock mode for a Bedrock provider that rpk ai cannot read.

--claude-config-dir

string

run against this CLAUDE_CONFIG_DIR instead of your real/inherited config home (rpk ai never writes into it; the managed apiKeyHelper rides in --settings). Default: your real home, so trust/onboarding/theme/MCP all apply.

-L, --llmprovider

name

AI gateway LLM provider name to route through (an anthropic, bedrock, vertex or fireworks provider).

-m, --model

string

Request this model ID through the gateway. It must be in any configured allowlist, and Fireworks requires a nonempty allowlist.

--passthrough

bool

Relay your Claude subscription login to Anthropic instead of the provider’s stored API key for a provider that rpk ai cannot read.

--print-settings

bool

Print the validated Claude Code settings and launch environment, then exit without launching Claude Code or creating an API key. Provider read access is required unless the legacy --bedrock or --passthrough mode is selected explicitly.

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.