Subkeys & Quotas

Issue scoped API keys with spending caps and usage ceilings for team members, clients, or automated test runners.

Subkeys allow you to generate secondary API keys backed by your primary account balance, with optional hard spending limits.

Subkey Architecture

Subkeys are ideal for:

  • Autonomous Agent Loops: Cap agent spend to $10 so runaway recursive loops cannot drain your wallet.
  • Team Members & Contractors: Give contributors access without exposing your master account PIN.
  • CI/CD Pipelines: Isolate testing keys per branch or repository.

Create a Subkey

Endpoint: POST https://api.toknix.in/v1/subkeys

bash
curl https://api.toknix.in/v1/subkeys   -H "Authorization: Bearer $TOKNIX_API_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "eval-runner-ci",
    "max_budget_usd": 25.00
  }'
json
{
  "object": "subkey",
  "id": "sk_sub_9a8f1b2c3d4e5f6a",
  "key": "tk_live_sub_8f2a1b9c...",
  "name": "eval-runner-ci",
  "max_budget_usd": 25.00,
  "spent_usd": 0.00,
  "created_at": 1740000000
}

List Active Subkeys

bash
curl https://api.toknix.in/v1/subkeys   -H "Authorization: Bearer $TOKNIX_API_KEY"

Revoke a Subkey

bash
curl -X DELETE https://api.toknix.in/v1/subkeys/sk_sub_9a8f1b2c3d4e5f6a   -H "Authorization: Bearer $TOKNIX_API_KEY"