For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Claude Desktop
Configure Claude Desktop to use agentgateway running in Kubernetes
Configure Claude Desktop to route requests through your agentgateway proxy running in Kubernetes using a Claude Teams or Pro account.
Before you begin
- Set up an agentgateway proxy.
- Install Claude Desktop.
- Install the Claude Code CLI (
npm install -g @anthropic-ai/claude-code). This is required to runclaude setup-tokenand obtain your bearer token. - Have a Claude Teams or Pro subscription.
Get the gateway URL
export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Gateway address: $INGRESS_GW_ADDRESS"Set up the Anthropic backend
Create an AgentgatewayBackend for the Anthropic provider. No API key is needed because authentication uses your Claude subscription via OAuth.
kubectl apply -f- <<EOF apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayBackend metadata: name: anthropic-desktop namespace: agentgateway-system spec: ai: provider: anthropic: {} policies: ai: routes: '/v1/messages': Messages '/v1/messages/count_tokens': AnthropicTokenCount '*': Passthrough EOFCreate an
AgentgatewayPolicyto raise the body buffer limit to 10 MB for the OAuth token flow.kubectl apply -f- <<EOF apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayPolicy metadata: name: claude-desktop-buffer namespace: agentgateway-system spec: targetRefs: - group: gateway.networking.k8s.io kind: Gateway name: agentgateway-proxy frontend: http: maxBufferSize: 10485760 EOFClaude Code automatically sends the
anthropic-beta: oauth-2025-04-20header required for OAuth-based authentication. Claude Desktop might require this header to be set as well depending on your client version. If requests fail with a 400 error, add a request transformation to the AgentgatewayPolicy that injects the header.backend: transformation: request: set: - name: anthropic-beta value: oauth-2025-04-20Create an
HTTPRoutethat matches the/claudepath prefix and rewrites it to/before forwarding to the backend.kubectl apply -f- <<EOF apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: claude-desktop namespace: agentgateway-system spec: parentRefs: - name: agentgateway-proxy namespace: agentgateway-system rules: - matches: - path: type: PathPrefix value: /claude backendRefs: - name: anthropic-desktop namespace: agentgateway-system group: agentgateway.dev kind: AgentgatewayBackend filters: - type: URLRewrite urlRewrite: path: type: ReplacePrefixMatch replacePrefixMatch: / EOF
Configure Claude Desktop
Get a bearer token for your Claude account. Store the value in a safe place.
claude setup-tokenOpen Claude Desktop and enable developer mode from the menu bar: Help → Troubleshooting → Enable Developer Mode. Then fully quit and relaunch Claude Desktop. A new Developer menu appears in the menu bar.
In the menu bar, go to Developer → Configure Third Party Inference → Gateway.
Enter the Gateway base URL.
http://$INGRESS_GW_ADDRESS/claudeFor the Credential kind dropdown, select
Static API keyand then in the Gateway API key field, enter the bearer token you copied in step 1.Click Save Changes and restart Claude Desktop.
Verify the connection
Send a message in Claude Desktop, such as
test.Check the proxy logs to confirm traffic is flowing through agentgateway.
kubectl logs deployment/agentgateway-proxy -n agentgateway-system --tail=5
Cleanup
Remove the resources that you created.
kubectl delete AgentgatewayPolicy claude-desktop-buffer -n agentgateway-system kubectl delete httproute claude-desktop -n agentgateway-system kubectl delete AgentgatewayBackend anthropic-desktop -n agentgateway-systemRestore Claude Desktop to your original settings. For example, you might delete the
~/Library/Application Support/Claude-3p/direcotry to remove third-party inference settings and use the default~/Library/Application Support/Claude/settings. For more information, see the Claude docs.