Guides

Read your organization's usage and keys from code with an admin key

Overview

The Admin API lets your own tools read data about your organization: usage over time by API key, endpoint and plan, and lists of your search API keys and admin keys. Use it for dashboards, warehouse exports and key audits. It is read-only and reports usage, not cost.

It uses admin keys, which are separate from the API keys you search with. An admin key can’t run searches, and a search API key can’t call the Admin API.

EndpointScopeReturns
GET /admin/v1/usageusage:readUsage in UTC time buckets
GET /admin/v1/api_keysapi_keys:readYour search API keys, without secrets
GET /admin/v1/admin_keysadmin_keys:readYour admin keys, without secrets
GET /admin/v1/meanyThe calling admin key and its organization

Ids in responses are prefixed key_ (search keys), akey_ (admin keys) and plan_ (plans).

Admin keys

Create a key

Owners and Admins create admin keys on the Admin keys page. If you signed in more than 15 minutes ago, you’re asked to sign in again first.

  1. Name the key after the integration that will use it. You can rename it later.
  2. Pick only the scopes it needs. Scopes can’t be changed later: to change them, create a new key, switch your integration over, then delete the old one.
  3. Choose when it expires: 30 days, 90 days, 1 year, or never. This can’t be changed later.
  4. Copy the key. It’s shown once; we store only a hash of it.

Admin keys start with bsk_admin_live_ and end in a checksum, so secret scanners can recognize them and a mistyped key is rejected straight away.

An organization can have up to 10 usable admin keys; paused, deleted and expired keys don’t count. Owners and Admins are emailed when a key is created, 7, 3 and 1 day before one expires, and when Brave Search staff delete or deactivate one.

Treat an admin key like a password: keep it on your server, never in a browser or mobile app. If one leaks, delete it on the Admin keys page; it stops working immediately.

Statuses

StatusMeaning
activeUsable until expires_at
inactivePaused by an Owner or Admin; can be resumed
deactivatedSuspended because the organization Owner’s account is on hold. It comes back when the hold is lifted; keys you had paused stay paused.
deletedRemoved for good
expiredPast expires_at

Admin keys belong to the organization, so they keep working when the member who created them leaves. The exception is the Owner’s account: if it’s put on hold, every usable key is deactivated, and while the hold lasts no key can be created or resumed. If the Owner’s account is deleted, its organizations’ admin keys are deleted with it.

Authentication

Send the admin key as a bearer token in the Authorization header. If your client can’t set Authorization, send the key in X-Admin-Key instead. When both are present, Authorization: Bearer wins.

curl "https://api.search.brave.com/admin/v1/me" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"
{
  "object": "admin_key",
  "id": "akey_xY7examplePublicIdHere",
  "name": "Finance warehouse sync",
  "scopes": ["admin_keys:read", "api_keys:read", "usage:read"],
  "status": "active",
  "expires_at": "2027-02-09T23:09:34Z",
  "organization": {
    "name": "Acme Search"
  }
}

/me works with any scope, so use it to check that a key is set up correctly. A key that can’t authenticate gets a 401, so a successful /me always reports active. organization has only its name.

Usage

GET https://api.search.brave.com/admin/v1/usage

Requires usage:read. Returns usage in UTC buckets, oldest first. Every bucket in the range is returned, including ones with no usage (with results: []).

Query parameters

ParameterTypeDefaultDescription
starting_atstringrequiredISO 8601 time with an offset, for example 2026-11-01T00:00:00Z. Rounded down to the bucket width. Can go back to the first day of the month, 12 months ago.
ending_atstringnowISO 8601 time with an offset. Rounded up to the bucket width; later times count as now.
bucket_widthstring1d1h, 1d or 1mo
group_bystring, repeatable—Split each bucket by api_key_id, endpoint and/or plan_id. Without it, a bucket has one total.
api_key_idsstring, repeatable—Only these search keys (key_…). At most 100.
endpointsstring, repeatable—Only these endpoints, for example web, news, images, videos, llm_context, summarizer, answers. At most 100.
plan_idsstring, repeatable—Only these plans (plan_…). At most 100.
limitint24 / 7 / 3Buckets per page for 1h / 1d / 1mo. At most 168 / 31 / 12.
pagestring—next_page from the previous response

Repeat a parameter to pass several values: group_by=plan_id&group_by=endpoint. The bracket form group_by[]=plan_id&group_by[]=endpoint works too. Ids that don’t belong to your organization, and endpoint names that don’t exist, match nothing rather than returning an error.

Write times in UTC with Z. A literal + in a URL is read as a space, so +00:00 must be sent as %2B00:00; HTTP libraries that build the query string for you handle this.

Example

curl "https://api.search.brave.com/admin/v1/usage?starting_at=2026-11-01T00:00:00Z&bucket_width=1d&group_by=plan_id&limit=1" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"
{
  "object": "list",
  "data": [
    {
      "object": "usage_bucket",
      "starting_at": "2026-11-01T00:00:00Z",
      "ending_at": "2026-11-02T00:00:00Z",
      "results": [
        {
          "api_key_id": null,
          "endpoint": null,
          "plan_id": "plan_mN9examplePublicIdHere",
          "requests": 1520,
          "queries": null,
          "input_tokens": null,
          "output_tokens": null
        }
      ]
    }
  ],
  "api_keys": {},
  "plans": {
    "plan_mN9examplePublicIdHere": {
      "name": "Search",
      "billing_model": "metered_postpaid",
      "billed_on": ["requests"]
    }
  },
  "has_more": true,
  "next_page": "MjAyNi0xMS0wMlQwMDowMDowMCswMDowMHwyNjJjMDFmYmVlYjE",
  "data_refreshed_at": "2026-11-11T15:02:00Z"
}

Response fields

FieldTypeDescription
data[].starting_atstringStart of the bucket (inclusive, UTC)
data[].ending_atstringEnd of the bucket (exclusive, UTC)
data[].results[]arrayOne row per group in the bucket
results[].api_key_idstring / nullSearch key id when grouped by key; null for usage made without a key or by a key that no longer exists
results[].endpointstring / nullEndpoint when grouped by endpoint
results[].plan_idstring / nullPlan id when grouped by plan
results[].requestsint / nullRequests, or null if no plan in the row bills on them
results[].queriesint / nullQueries, or null if no plan in the row bills on them
results[].input_tokensint / nullInput tokens, or null if no plan in the row bills on them
results[].output_tokensint / nullOutput tokens, or null if no plan in the row bills on them
api_keysobjectFor every api_key_id on the page: name, hint (last 4 characters) and status
plansobjectFor every plan with usage on the page, grouped by plan or not: name, billing_model and billed_on
has_moreboolWhether there is another page
next_pagestring / nullPass as page to get the next page
data_refreshed_atstring / nullWhen usage was last synced; null if unknown. See Freshness.

Rows carry ids only; names and plan details are in the api_keys and plans maps, once per page.

Measures and null

Each plan bills on either requests, or on queries, input_tokens and output_tokens; its billed_on lists which. A measure that doesn’t apply is null, not 0, so you can tell “doesn’t apply” from “no usage”. A row that mixes plans, for example without group_by=plan_id, has a number for every measure that at least one of its plans bills on.

Hours and days vs months

1h and 1d buckets count requests as they’re recorded. 1mo buckets are the billed totals your invoices use, so a month of 1d buckets can differ slightly from the 1mo bucket for that month. Reconcile against invoices with 1mo, and use 1h or 1d for charts and monitoring.

Pagination

Send the same query parameters again with page set to next_page, until has_more is false. A page can stop before limit buckets when it has a lot of rows (more than 5,000); has_more tells you whether to continue.

import time

import requests

URL = "https://api.search.brave.com/admin/v1/usage"
HEADERS = {"Authorization": "Bearer YOUR_ADMIN_KEY"}
params = {
    "starting_at": "2026-10-01T00:00:00Z",
    "bucket_width": "1d",
    "group_by": ["api_key_id", "endpoint"],
    "limit": 31,
}

buckets = []
while True:
    response = requests.get(URL, headers=HEADERS, params=params)
    if response.status_code in (429, 503):
        time.sleep(int(response.headers.get("Retry-After", "5")))
        continue
    response.raise_for_status()
    page = response.json()
    buckets += page["data"]
    if not page["has_more"]:
        break
    params["page"] = page["next_page"]

Freshness

Usage appears within about 5 to 10 minutes of the request. data_refreshed_at is when usage was last synced; requests from the few minutes before it may still be on their way. Buckets that ended more than 2 hours before it won’t change, so for numbers that won’t move, set ending_at at least 2 hours before a data_refreshed_at you’ve already seen.

Poll about every 5 minutes for dashboards and alerts; more often returns the same numbers. For history, prefer 1d buckets: a year of 1h buckets takes more than 50 pages.

Search API keys

GET https://api.search.brave.com/admin/v1/api_keys

Requires api_keys:read. Returns your organization’s search API keys, oldest first. Deleted keys, including those of cancelled subscriptions, are left out unless you pass include_deleted=true.

ParameterTypeDefaultDescription
include_deletedboolfalseInclude deleted keys
limitint100Keys per page (1–1000)
pagestring—next_page from the previous response
{
  "object": "list",
  "data": [
    {
      "object": "api_key",
      "id": "key_aB3examplePublicIdHere",
      "name": "Production web",
      "hint": "7f2a",
      "status": "active",
      "plan": {
        "id": "plan_mN9examplePublicIdHere",
        "name": "Search",
        "billing_model": "metered_postpaid",
        "billed_on": ["requests"]
      },
      "created_by_name": "Alex Example",
      "created_at": "2026-03-01T12:00:00Z"
    }
  ],
  "has_more": false,
  "next_page": null
}
FieldTypeDescription
data[].idstringSearch key id (key_…), as in usage rows
data[].namestring / nullDisplay name
data[].hintstringLast 4 characters of the key
data[].statusstringactive, inactive or deleted
data[].planobjectThe key’s plan: id, name, billing_model, billed_on
data[].created_by_namestring / nullMember who created it; null when unknown or created by Brave Search staff
data[].created_atstringCreation time (UTC)

Admin keys list

GET https://api.search.brave.com/admin/v1/admin_keys

Requires admin_keys:read. Returns your organization’s admin keys, oldest first, with the same include_deleted, limit and page parameters as search API keys. Creating, pausing and deleting admin keys is done on the dashboard.

{
  "object": "list",
  "data": [
    {
      "object": "admin_key",
      "id": "akey_xY7examplePublicIdHere",
      "name": "Finance warehouse sync",
      "hint": "9c1e",
      "status": "active",
      "scopes": ["api_keys:read", "usage:read"],
      "expires_at": "2027-02-09T23:09:34Z",
      "last_used_at": "2026-11-11T14:00:00Z",
      "created_by_name": "Alex Example",
      "created_at": "2026-02-09T23:09:34Z"
    }
  ],
  "has_more": false,
  "next_page": null
}
FieldTypeDescription
data[].idstringAdmin key id (akey_…)
data[].namestringDisplay name
data[].hintstringLast 4 characters of the key
data[].statusstringOne of the statuses
data[].scopesstring[]Granted scopes
data[].expires_atstring / nullExpiry (UTC), or null if it never expires
data[].last_used_atstring / nullLast authenticated request, to within an hour; null if never used
data[].created_by_namestring / nullMember who created it; null when unknown
data[].created_atstringCreation time (UTC)

Errors

Errors use the same format as the rest of the Brave Search API:

{
  "type": "ErrorResponse",
  "error": {
    "id": "6f1c1c9e-2f5b-4a55-9a4e-0f4f3c1b2a77",
    "status": 403,
    "code": "ADMIN_KEY_SCOPE_MISSING",
    "detail": "This admin key doesn't have the scope this endpoint needs.",
    "meta": {
      "required_scope": "usage:read",
      "granted_scopes": ["api_keys:read"],
      "component": "authorization"
    }
  },
  "time": 1794000000
}
StatusCodeWhen
401ADMIN_KEY_INVALIDThe key is missing, mistyped, unknown, paused, deactivated, deleted or expired. All of these get the same answer.
403ADMIN_KEY_SCOPE_MISSINGThe key lacks the endpoint’s scope; meta lists what it needs and has
404API_VERSION_NOT_FOUNDUnknown Api-Version
422VALIDATIONA parameter is missing or invalid, for example a time without an offset, too many filter values, limit too high, or a page from a different query
422INVALID_TIME_RANGEstarting_at is too far back, in the future, or not before ending_at
429ADMIN_RATE_LIMITEDToo many requests; wait for Retry-After seconds
503ADMIN_OVERLOADEDTemporarily busy; wait for Retry-After seconds

Rate limits

Limits apply to your organization as a whole, however many admin keys you use, with tighter ones on /usage. Every authenticated response carries X-RateLimit-Limit, X-RateLimit-Policy, X-RateLimit-Remaining and X-RateLimit-Reset, one value per limit, in the same format as the search API (see Rate limiting).

Walking the pages of one export back to back is fine. On a 429 or 503, wait for the seconds in Retry-After and retry, as the pagination example does.

Versioning

The path carries the major version (/admin/v1/...), which changes only for rare, breaking redesigns. Smaller incompatible changes are dated, as for the rest of the Brave Search API (see Versioning). Without an Api-Version header you get the latest; to keep a response format, pin it:

Api-Version: 2026-11-12

The current Admin API version is 2026-11-12. Successful responses include X-Api-Version with the version that served the request.

Changelog

2026-11-12

  • Launch the Admin API at /admin/v1
  • Endpoints: /usage, /api_keys, /admin_keys, /me
  • Admin keys with scopes usage:read, api_keys:read and admin_keys:read