Management keys & activity
Create a key with scope "management" to provision keys from your own backend — one per customer, each with its own spend limit (limit + limit_reset: daily, weekly, monthly or never), model allowlist and rate limits — via /keys, and to manage presets via /presets. Management keys cannot call models. GET /activity returns daily usage per model and endpoint for the last 30 days (whole workspace for management keys, the key itself otherwise), filterable by date, key and end user. POST /generations/lookup returns the exact cost of up to 1,000 request ids at once — ideal for billing your own customers.
# With a management key: provision a key per customer, capped at $20/month
curl https://api.ultragpt.pro/v1/keys -H "Authorization: Bearer $ULTRAGPT_MANAGEMENT_KEY" -H "Content-Type: application/json" \
-d '{ "name": "customer-42", "limit": 20, "allowed_models": ["gpt-5-mini"], "rpm_limit": 60 }'
# -> { "data": { "id": "...", "limit_remaining": 20, ... }, "key": "ugpt_live_..." } (shown once)
curl https://api.ultragpt.pro/v1/keys -H "Authorization: Bearer $ULTRAGPT_MANAGEMENT_KEY" # list
curl -X PATCH https://api.ultragpt.pro/v1/keys/KEY_ID -d '{ "limit": 50 }' ... # update
curl -X DELETE https://api.ultragpt.pro/v1/keys/KEY_ID -H "Authorization: Bearer $ULTRAGPT_MANAGEMENT_KEY" # revoke
# Daily usage per model for the last 30 days (?date=, ?key_id=, ?user=)
curl https://api.ultragpt.pro/v1/activity -H "Authorization: Bearer $ULTRAGPT_MANAGEMENT_KEY"
# Exact cost of up to 1000 requests at once (any key, incl. read-only)
curl https://api.ultragpt.pro/v1/generations/lookup -H "Authorization: Bearer $ULTRAGPT_API_KEY" -H "Content-Type: application/json" \
-d '{ "ids": ["chatcmpl-...", "chatcmpl-..."] }'