Skip to content

Custom resources ​

All three live in the API group valetkey.dev/v1alpha1 and report a standard Ready condition in their status. A Provider's condition reason is KeyResolved, SecretUnavailable or KeyRejected (the provider answered 401 or 403 to the key). Short names: prov, tn, pkey.

Provider ​

A provider. Namespace: the operator namespace.

FieldTypeDefaultDescription
typeopenai | anthropicrequiredopenai covers every OpenAI-compatible API
baseURLstringrequirede.g. https://api.openai.com. A path prefix (like /api) is kept; a trailing /v1 isn't doubled
keySecretRef.namestringrequiredSecret in the operator namespace holding the real key
keySecretRef.keystringapiKeyKey inside that Secret
modelsstring[]anyModels this provider may serve
priorityint10Share of traffic when several providers serve a model
statusEnabled | DisabledEnabled
modelMappingmapnoneRequested model → model sent upstream
proxyURLstringnoneOutbound HTTP proxy for this provider
skipTLSVerifyboolfalseSkip TLS verification (self-signed endpoints only)
pricing.providerstringguessed from baseURLPrice catalogue provider (models.dev id), e.g. deepseek
pricing.modelsmapnonePer-model prices in dollars per million tokens: input, output, cacheRead, cacheWrite, cacheWrite1h. See Budgets & costs

Tenant ​

A tenant. Namespace: the operator namespace. Its name is the tenant namespace.

FieldTypeDefaultDescription
providersstring[]requiredProviders this tenant may use
statusEnabled | DisabledEnabledDisabled stops every key of the tenant
rpmRationumber1.0Multiplies each key's rpm
tpmRationumber1.0Multiplies each key's tpm
budget.usdstringnoneDollar budget per period for all the tenant's keys, e.g. "200"
budget.perioddaily | weekly | monthlymonthly
budget.timezonestringUTCIANA time zone where periods start

ProxyKey ​

An API key. Namespace: the tenant's namespace.

FieldTypeDefaultDescription
statusEnabled | DisabledEnabled
modelsstring[]anyModels this key may use
subnetsstring[]anyAllowed client IP ranges (IPv4/IPv6 CIDR or single address)
rpmintunlimitedRequests per minute (× tenant rpmRatio)
tpmintunlimitedTokens per minute (× tenant tpmRatio)
budget.usdstringnoneDollar budget per period for this key, e.g. "20"
budget.perioddaily | weekly | monthlymonthly
budget.timezonestringUTCIANA time zone where periods start
modelBudgetsmapnoneBudgets for single models, e.g. claude-opus-4-5: {usd: "5", period: daily}
maxTokensintnoneOutput cap added to requests that don't set one
expiresAtRFC 3339 timeneverWhen the key stops working

Annotation valetkey.dev/rotate: set it to a new value to issue a new key (see Rotating a key).

Status fields: ready, message, conditions, secretName, keyHash (SHA-256 of the key; the key itself is only in the Secret), rotation (the valetkey.dev/rotate value the current key was issued for), spend (current period: usd across all replicas, periodStart, requests, and each replica's share under pods) and modelSpend (the same per model in modelBudgets). Groups have spend too.

Full example ​

See examples/quickstart.yaml: two providers, one tenant, two keys.

Released under the ISC License.