Skip to content
Open CastalyConsole

Platform features

Enterprise accounts

How API keys, member budgets, errors, and logs behave when a team shares one enterprise balance.

An enterprise account lets a whole team spend from one balance. The owner’s account balance becomes the enterprise balance, every member calls the API with their own key, and every charge comes out of that shared balance. Endpoints, request bodies, and client setup are the same as for a personal account; this page covers only what changes when the caller belongs to an enterprise.

A member sends a request

acme-…

With their own key, which starts with the enterprise prefix.

Budget check

The estimated cost has to fit in what is left of the member's budget.

Charged to the enterprise

At the owner account's prices, groups and subscription.

Logged under the member

The owner and admins can break it down by member, model, key and date.

Members never hold money of their own. A budget only caps what they can spend from the enterprise balance.
Role Account What it can do
Owner The account that applied Its balance is the enterprise balance. Manages everyone, tops up, and sees usage for the whole enterprise. Cannot be disabled.
Admin Created from an invitation Calls the API under a budget, invites and manages members, tops up, and sees usage for the whole enterprise.
Member Created from an invitation Calls the API, the image and video workbench, and Castaly under a budget. Cannot top up.

Admins and members are new accounts created from an email invitation. The invited email address must not already be registered, so an existing personal account cannot join an enterprise. These accounts do not take part in platform rewards.

The owner and admins can disable an account at any time, and its sessions and keys stop working immediately. Accounts are disabled, never deleted, so their usage history stays.

Enterprise keys start with the enterprise’s key prefix, for example acme- followed by 48 letters and digits. You choose the prefix when you apply; it is fixed at approval and cannot be changed later. A prefix is 2 to 16 lowercase letters and digits and starts with a letter.

The same key also works with sk- in place of the prefix. Use that spelling for any client that only accepts keys starting with sk-: both spellings are the same key, with the same permissions and billing.

Text
Authorization: Bearer acme-<48 characters>
Authorization: Bearer sk-<48 characters>

A key presented with a prefix that is not its own enterprise’s is rejected as an invalid key with 401.

Keys the owner created before the application was approved are shown with the enterprise prefix as well. Their sk- spelling keeps working, so existing integrations need no change.

Admins and members create and see only their own keys in the console. The owner and admins can manage every key of the enterprise from the enterprise console, filtered by member.

Every admin and member has a budget. No money moves to them; the budget is the most they may spend from the enterprise balance.

Mode Behaviour
Unlimited Bounded only by the enterprise balance.
One-time A fixed allowance that never resets on its own.
Monthly Starts again from zero at 00:00 UTC on the 1st of every month.

Changing only the limit keeps the amount already used. Switching to another mode starts counting from zero.

Before a request runs, the gateway reserves its estimated cost against the member’s remaining budget and refuses the request if it does not fit. The request then settles at its real cost. Settlement never refuses, so the last request can leave a member slightly over the limit; the next one is refused. When a request fails or is refunded, the amount goes back to the member’s budget as well.

Members get an email when they have used 80% of their budget and again when it runs out.

To the gateway, a member’s request is a request from the owner account. Everything apart from the budget follows the owner:

  • Charges come out of the enterprise balance the same way they would for the owner, including the owner’s subscription.
  • Prices, groups, and the models a key can call are those of the owner account.
  • Rate limits count the whole enterprise. The owner and every member share one allowance, so a 429 can be caused by someone else’s traffic.

When the enterprise balance runs out, requests from everyone in the enterprise fail with 403 and insufficient_user_quota, as they would for a personal account. The owner and admins can top up from the enterprise console; members cannot. With a balance alert set, the owner and admins get an email when the balance falls below it.

Situation Status How to recognise it
The key carries another enterprise’s prefix 401 Rejected as an invalid key
The member’s budget is used up 403 code is enterprise_member_budget_exhausted
The member was disabled, or the enterprise was suspended 403 message says the account is disabled
The enterprise balance is used up 403 code is insufficient_user_quota
The enterprise as a whole hit a rate limit 429 Same as for a personal account

Retrying does not clear the 401 and 403 cases. A budget error clears when an admin raises the limit or, for a monthly budget, when the next month starts; a balance error clears after a top-up.

A task submitted with a member’s key can only be queried with that member’s keys. Querying it with another member’s key returns the same result as a task that does not exist. The owner’s keys can query tasks submitted by anyone in the enterprise.

  • Every request log records which member sent the request.
  • In their own console, admins and members see only their own requests.
  • The owner’s log page shows requests from the whole enterprise, with an extra Member column.
  • The owner and admins can break spend down by member, model, key, and date in the enterprise console, and open any member’s individual requests.
  • How far back this goes follows the owner account’s log retention, see Data retention. If the owner shortens it, enterprise reports shorten with it.

Apply from the Modelflare console with the enterprise name, the key prefix you want, and a contact email. Once the application is approved, your account becomes the owner, its balance becomes the enterprise balance, and you invite your team from the enterprise console. The Enterprise page describes the full plan.