Skip to content
Docs
Open Bearly

Create an API key for your organization

How to create a Bearly API key for your organization in Bearly Platform, choose a service account, personal, or admin key, set its models, monthly cap, rate limit, and expiry, and rotate or revoke it.

⋯
View as markdown

Organization admins create API keys in Bearly Platform under Keys & access (“Let scripts, services and the Bearly CLI use your organization’s models, within limits you set.”). A key lets your own code call Bearly’s models through the Bearly API with the OpenAI or Anthropic SDK.

You need: the organization admin role, and Bearly API on under Policies → Access (Turn the API and CLI on or off). For a service-account key, add the service account first and API credit to pay for its requests.

  1. Open Keys & access → API keys and select Create key.

  2. Choose a Type:

    • Service account: “For scripts and services. Spend counts against the service account’s cap.” Then choose the service account.
    • Personal: “Acts as you, with your policy and limits.”
    • Admin: “Manages this organization through the API, such as reading usage or adding members. It can’t call models.” Choose what It can do: Read usage, Read the audit log, Read members, Add and change members, or Create and revoke keys. If Admin can’t be chosen, the form says why.
  3. Enter a Name that says where the key runs, such as “Nightly report job”.

  4. Optionally narrow the key:

    • Models: Every model its policy allows, or Only models I choose, still within its policy.
    • Monthly cap: the most the key can spend each month.
    • Requests per minute.
    • Expires: Never, In 7 days, In 30 days, In 90 days, or In a year.
    • Group: a group whose budget its spend also counts toward.

    An empty limit means the key has no limit of its own.

  5. Select Create key. Copy the key for name shows the key, the API base URL https://api.bearly.ai/v1, and a first curl command, each with a copy button.

API keys lists each key with its type, who it acts as, its limits, when it was last used, and its status: Active, Replaced, At cap, Expired, or Revoked. Select Show revoked to list revoked keys too.

Open a key’s menu:

  • Edit changes its name and limits.
  • Rotate makes a new key with the same settings. Choose how long the current key keeps working: Stop it now, Keep it for 1 hour, or Keep it for 24 hours. Rotate when a key may have leaked or on a schedule.
  • Revoke stops the key right away. “You can’t undo this.”

A service-account key is refused when:

  • its key, its service account, its group, or the organization reaches a monthly limit, until the 1st (UTC);
  • it uses up its requests per minute, until the minute passes;
  • the organization’s API credit runs out: 402 with “Your organization’s API credit has run out. An admin can add credit in Bearly Platform.”;
  • Bearly API is off: 403 with “Your organization’s policy doesn’t allow API keys.”

Admin keys can’t call models. See Errors for every response.

Members create their own personal keys in Bearly: account menu → Developers → API keys. Those keys act as the member and use their plan. See Use the Bearly API.