Skip to content

Admin API ​

The dashboard uses this API; you can script it too. It listens on 127.0.0.1:8082 inside the pod, so you reach it through a port-forward. There's no password: access is controlled by who may port-forward to the pod (Kubernetes RBAC).

Every request needs the header X-Valetkey-Request: 1 and must target localhost (see Security). Errors are JSON: {"message": "…"}.

bash
kubectl port-forward -n valetkey-system deploy/valetkey 8082:8082 &
curl -H "X-Valetkey-Request: 1" http://localhost:8082/api/v1/proxykeys

Overview ​

MethodPathDescription
GET/api/v1/overviewTotals, 24 h series, traffic share, provider health, counts
GET/api/v1/activityLast 500 requests and recent events (newest first)
GET/api/v1/namespacesNamespaces, flagging which already have a tenant

Providers ​

MethodPathDescription
GET/api/v1/providersList
POST/api/v1/providersCreate: {"name", "spec", "apiKey"}; apiKey is stored in a managed Secret
GET / PUT / DELETE/api/v1/providers/{name}Read, replace spec (optional new apiKey), delete
POST/api/v1/providers/{name}/testCheck the key by listing the provider's models
GET/api/v1/providers/{name}/yamlThe Provider as YAML, without status or server-managed fields (its key Secret is never included)
POST/api/v1/models/discoverList a provider's models before saving it: {"spec", "apiKey"} or {"spec", "provider"}

Tenants ​

MethodPathDescription
GET/api/v1/tenantsList
POST/api/v1/tenantsCreate: {"name", "spec"}
GET / PUT / DELETE/api/v1/tenants/{name}Read, replace spec, delete
GET/api/v1/tenants/{name}/modelsEvery model the tenant's keys can use
GET/api/v1/tenants/{name}/yamlThe tenant's whole file as YAML: its Namespace, Tenant and ProxyKeys, without status or server-managed fields

API keys ​

MethodPathDescription
GET/api/v1/proxykeysList (all namespaces)
POST/api/v1/proxykeysCreate: {"namespace", "name", "spec"}
GET / PUT / DELETE/api/v1/proxykeys/{ns}/{name}Read, replace spec, delete
GET/api/v1/proxykeys/{ns}/{name}/keyReveal the key (audited)
POST/api/v1/proxykeys/{ns}/{name}/rotateIssue a new key; the old one stops working (audited)
GET/api/v1/proxykeys/{ns}/{name}/yamlThe ProxyKey as YAML, without status or server-managed fields

Every write is recorded in the audit trail.

Released under the ISC License.