Bridge by Wekoya / Docs / Your account

Key limits and models

Updated

A key can be limited to some models, so a leaked or misused key cannot run up a bill on the most expensive one. Rules are exact ids (claude-sonnet-5), prefixes (claude-*), or makers (vendor:anthropic). An end user can be narrowed further, never widened past their key.

# A key that may only call Claude models:
curl https://wekoya-api.wekoya.tech/v1/keys \
  -H "Authorization: Bearer $WEKOYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "grading", "allowed_models": ["claude-*"] }'

# Change it later, or send null to allow every model again:
curl -X PATCH https://wekoya-api.wekoya.tech/v1/keys/KEY_ID \
  -H "Authorization: Bearer $WEKOYA_API_KEY" -H "Content-Type: application/json" \
  -d '{ "allowed_models": ["claude-sonnet-5", "vendor:google"] }'

An exact id that is not in the catalogue is refused when you save it, because a typo would otherwise lock the key out of everything. Prefixes and makers are not checked, soclaude-* keeps working for a model launched next month.

A key's monthly spending limit

A key can also have a monthly limit. When this month's spending with it reaches the limit, its requests are refused with key_limit_exceeded until the 1st, or until you raise the limit. Change it any time under API keys (Edit, or Raise limit on a key that has reached it), or from code with a key that has the admin scope. It applies from the next request, and the key stays the same, so nothing that uses it needs to change. The limit only caps spending: requests are still paid from your balance.

# Let a key spend up to ₦200,000 a month (in kobo). The key itself does not change.
curl -X PATCH https://wekoya-api.wekoya.tech/v1/keys/KEY_ID \
  -H "Authorization: Bearer $WEKOYA_ADMIN_KEY" -H "Content-Type: application/json" \
  -d '{ "monthly_limit_minor": 20000000 }'

# Or send null for no monthly limit:
  -d '{ "monthly_limit_minor": null }'

A key cannot raise its own limit or widen its own models. In a company, a member can change only their own keys, up to the monthly limit an admin set for them.