Apikee

Clients & Keys

Managing clients (customers) and their API keys on the apikee platform.

Clients & Keys

A client represents one of your API's customers. Each client can have multiple API keys. Clients belong to a project environment.

Client types

TypeUse case
personIndividual end user
companyBusiness customer
serviceBackend service or microservice
deviceIoT device or embedded hardware
internalInternal tool or team

Creating clients

The easiest way is to let the SDK create clients automatically when you issue a key:

# Python — auto-creates client on apikee.dev
key = apikee.create(
    tenant="acme-corp",
    scopes=["read", "write"],
    client_name="Acme Mobile Backend",
    client_type="service",
    template_id="clt_abc123",            # rate limit template
    ip_whitelist=["203.0.113.0/24"],
)

Or call the API directly:

curl -X POST "https://apikee.dev/api/v1/client?project_env=my-api-production" \
  -H "x-api-key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "type": "company",
    "templateId": "clt_abc123",
    "ipWhitelist": ["203.0.113.0/24"],
    "metadata": { "plan": "pro", "salesforceId": "001..." },
    "keys": [
      { "name": "Production Key", "expiresAt": "2026-12-31T23:59:59Z" }
    ]
  }'

The raw key secret is returned only on creation and is never stored by apikee. Copy it immediately and deliver it to your customer securely.

Key lifecycle

Create key  →  Active  →  Expired (natural)

                     Revoked (early, via dashboard or API)

Keys can be set to autoRotate: true for automatic renewal before expiry.

IP whitelisting

Set per-client IP restrictions. Accepts IPv4, IPv6, and CIDR ranges:

{
  "ipWhitelist": [
    "203.0.113.1",
    "198.51.100.0/24",
    "2001:db8::/32"
  ]
}

When an inbound request's x-forwarded-for IP doesn't match, validation fails with a 403.

Client stats

Each client has aggregated stats available via GET /client/{uuid}?project_env=...:

{
  "stats": {
    "total": 14823,
    "success": 14791,
    "error": 32,
    "avgDurationMs": 4
  }
}

On this page