Managing keys

Mint and revoke sk-hyd- API keys and register machines for the Claude proxy, using your account master token.

The AI Gateway uses three credential types. This page covers how to obtain and manage them programmatically. All endpoints here live at ai.hep.gg and are authenticated with your master token.

The three credentials

Credential types
master token
hyd_...optional
Account-level. Bearer token for the management endpoints below (/me, /keys, /sync/*). Issued once per account. Treat it like a password.
API key
sk-hyd-...optional
Model-pinned. Bearer token for the OpenAI-compatible endpoint. Minted from the master token; shown once.
proxy token
pt_...optional
Machine-level. Goes in the URL path of the Claude proxy. Issued when you register a machine.

Your account

GEThttps://ai.hep.gg/meAuth required
Return your AI account and its registered machines.

Send Authorization: Bearer hyd_.... Returns { user: { id, name, email }, machines: [...] }.

API keys

GEThttps://ai.hep.gg/modelsAuth required
List the model slugs you can bind a key to.

A key is pinned to one model at creation, so list the available slugs first. Returns the model catalog (for example cf-gpt-oss-20b).

POSThttps://ai.hep.gg/keysAuth required
Mint an sk-hyd- key bound to one model.
Body
name
stringrequired
A label for the key.
model
stringrequired
A model slug from GET /models (for example cf-gpt-oss-20b). An unknown slug returns 400.
curl
curl -X POST https://ai.hep.gg/keys \
  -H "Authorization: Bearer hyd_..." \
  -H "Content-Type: application/json" \
  -d '{"name":"my-script","model":"cf-gpt-oss-20b"}'

The response contains the full key (sk-hyd-...) exactly once, plus a short prefix. The secret is hashed at rest, so store it now; afterwards only the prefix is retrievable.

GEThttps://ai.hep.gg/keysAuth required
List your keys with usage counters (no secret).

Returns keys[] with id, name, model_slug, key_prefix, request_count, prompt_tokens, completion_tokens, last_used_at, disabled, and created_at.

DELETEhttps://ai.hep.gg/keys/:idAuth required
Delete one of your keys.

Returns { "ok": true }. You can only delete keys you own.

Registering a machine (for the Claude proxy)

POSThttps://ai.hep.gg/sync/machinesAuth required
Register a machine and receive a proxy_token.
Body
hostname
stringoptional
Machine hostname.
os
stringoptional
Operating system.
plan
stringoptional
Optional plan label.

Returns { id, proxy_token }. The proxy_token (pt_...) goes in the path of the Claude proxy. In practice the ccas CLI registers the machine and wires the proxy token for you, so you rarely call this by hand.