claude-code-api

by whitediver

Helm chartv0.1.1App 0.1.0Verified publisher

A Helm chart for deploying the Claude Code OpenAI-compatible API gateway

About this chart

Claude Code API Helm Chart

This Helm chart deploys the Claude Code API gateway, an OpenAI-compatible interface for Claude Code with built-in admin UI for exchanging OAuth tokens for API keys.

Prerequisites

  • Kubernetes 1.26+
  • Helm 3.12+

Installing the Chart

To install the chart with the release name claude-code-api:

helm install claude-code-api ./charts/claude-code-api \
  --set "auth.claudeOAuthToken.value=sk-ant-oat01-..." \
  --set "auth.adminPassword.value=super-secret"

The command deploys the API gateway and stores the provided credentials in a managed Kubernetes secret. See Parameters for the full list of configurable options.

Uninstalling the Chart

To uninstall/delete the claude-code-api deployment:

helm delete claude-code-api

Parameters

Global parameters

NameDescriptionValue
replicaCountNumber of replicas to deploy1
nameOverrideString to partially override claude-code-api.fullname""
fullnameOverrideString to fully override claude-code-api.fullname""

Image parameters

NameDescriptionValue
image.repositoryContainer image repositoryarbuzov/claude-code-api
image.tagContainer image tag (defaults to chart appVersion when empty)""
image.pullPolicyContainer image pull policyIfNotPresent
imagePullSecretsKubernetes image pull secrets[]

Service account parameters

NameDescriptionValue
serviceAccount.createSpecifies whether a service account should be createdtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameName of the service account to use""

Service parameters

NameDescriptionValue
service.typeKubernetes service typeClusterIP
service.ports.http.portService port for the HTTP API8000
service.ports.http.targetPortContainer port for the HTTP API8000
service.ports.https.enabledExpose the HTTPS admin port through the servicetrue
service.ports.https.portService port for the HTTPS admin UI8443
service.ports.https.targetPortContainer port for the HTTPS admin UI8443

Ingress parameters

NameDescriptionValue
ingress.enabledEnable ingress resourcefalse
ingress.classNameIngressClass used to implement the Ingress""
ingress.annotationsAdditional annotations for the Ingress{}
ingress.pathBase path for the ingress/
ingress.pathTypePath matching behaviorPrefix
ingress.hostsHostnames for the ingress["claude-code-api.local"]
ingress.tlsTLS configuration[]

Application parameters

NameDescriptionValue
app.portHTTP API port inside the container8000
app.httpsPortHTTPS admin port inside the container8443
app.nodeEnvNODE_ENV value for the serviceproduction
app.logLevelLOG_LEVEL value for the serviceinfo

Authentication parameters

NameDescriptionValue
auth.secret.createCreate and manage a Kubernetes secret for credentialsfalse
auth.secret.nameOverride name for the managed secret""
auth.secret.annotationsExtra annotations for the managed secret{}
auth.adminPassword.keyEnvironment variable key for the admin passwordADMIN_PASSWORD
auth.adminPassword.valuePlaintext admin password stored in the managed secret""
auth.adminPassword.valueBase64Base64-encoded admin password stored verbatim in the managed secret""
auth.adminPassword.existingSecretExisting secret to read the admin password fromclaude-code-api-auth
auth.adminPassword.existingSecretKeyKey inside the existing admin secretADMIN_PASSWORD
auth.claudeOAuthToken.keyEnvironment variable key for the Claude OAuth tokenCLAUDE_CODE_OAUTH_TOKEN
auth.claudeOAuthToken.valuePlaintext Claude OAuth token stored in the managed secret""
auth.claudeOAuthToken.valueBase64Base64-encoded Claude OAuth token stored verbatim in the managed secret""
auth.claudeOAuthToken.existingSecretExisting secret to read the Claude OAuth token fromclaude-code-api-auth
auth.claudeOAuthToken.existingSecretKeyKey inside the existing Claude OAuth secretCLAUDE_CODE_OAUTH_TOKEN

Environment parameters

NameDescriptionValue
envAdditional environment variables for the container{}
envSecretsEnvironment variables sourced from external secrets{}
secretEnv.dataAdditional key/value pairs stored in a dedicated secret and exposed as environment variables{}

Autoscaling parameters

NameDescriptionValue
autoscaling.enabledEnable Horizontal Pod Autoscalerfalse
autoscaling.minReplicasMinimum number of replicas1
autoscaling.maxReplicasMaximum number of replicas100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilization percentage80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilization percentage""

Resource parameters

NameDescriptionValue
resourcesResource requests and limits for the pod{}

Configuration and installation details

Providing the Claude OAuth token and admin password

The service requires both an admin password for the management UI and a Claude OAuth token used to generate client API keys. Provide these values via auth.* settings. By default, the chart expects an existing secret named claude-code-api-auth that contains both credentials. To have the chart manage this secret instead, set auth.secret.create=true and supply the values for auth.adminPassword.* and auth.claudeOAuthToken.*.

When the chart manages the secret, auth.adminPassword.value (or valueBase64) must be set to a non-empty value; the template rendering fails otherwise. If you point to existing secrets, you must also set auth.adminPassword.existingSecretKey and auth.claudeOAuthToken.existingSecretKey so the chart reads the correct keys.

When setting *.value, supply the plaintext credential; the chart encodes it before writing to the Kubernetes Secret. To supply a pre-encoded value, use the corresponding *.valueBase64 setting instead.

Exposing the service

Enable ingress by setting ingress.enabled=true and configure ingress.hosts and TLS as needed. The service listens on port 8000 for the OpenAI-compatible API and 8443 for the admin UI.

Deploy claude-code-api with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has claude-code-api on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartclaude-code-api is pinned at v0.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply