Skip to main content
curl --request POST \
  --url https://api.baseten.co/v1/gateway/groups/abc123hash/api_keys/register \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "acme-prod-key-1",
    "key": "<your-securely-generated-api-key>"
  }'
{
  "ok": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.baseten.co/llms.txt

Use this file to discover all available pages before exploring further.

Register a caller-supplied API key against an existing group. This exists for white-label deployments where you already mint keys for your end users and want Baseten inference under the hood without forcing them to rotate. The registered key inherits the group’s full live model set and effective limits — exactly like a key produced by Create an API key. Baseten stores only the hashed key; once registered, the plaintext value is unrecoverable from our side.

Key requirements

The key value you submit must satisfy these constraints. The endpoint returns 400 Bad Request if any check fails:
ConstraintRule
LengthBetween 32 and 128 characters, inclusive.
ComplexityShannon entropy of at least 3.0 bits per character. This is a low-bar heuristic that catches obviously hand-typed or repeated-character strings; any securely-generated random key clears it easily.
UniquenessThe first 16 characters become the key’s stored prefix and must not already be registered in your workspace.
Generate keys with a cryptographically secure random source on your side and bring them to this endpoint — Baseten does not return a generated key from this call.

Authentication

Authorization
string
required
Workspace API key with management scope, formatted as Api-Key <your-key>.

Path parameters

group_id
string
required
Internal Baseten ID of the group to register the key under. Returned as id from Create a group.

Body

key
string
required
The plaintext API key to register. Must satisfy the key requirements. Hand this value to the downstream consumer through your own secure channel — Baseten does not echo it back.
name
string
Display name for the key. Useful for distinguishing multiple keys under the same group.

Response

ok
boolean
required
true when the registration succeeded. The endpoint does not return the key — store it on your side before calling.

Errors

StatusMeaning
400 Bad RequestThe supplied key failed length, complexity, or uniqueness validation.
403 ForbiddenThe group exists but isn’t in your workspace, or the caller doesn’t have management scope.
404 Not FoundNo group with this id in your workspace, or it has been deleted.
curl --request POST \
  --url https://api.baseten.co/v1/gateway/groups/abc123hash/api_keys/register \
  --header "Authorization: Api-Key $BASETEN_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "acme-prod-key-1",
    "key": "<your-securely-generated-api-key>"
  }'
{
  "ok": true
}