Teams and budgets: company accounts, roles and monthly limits
A company account has one shared wallet and is divided into workspaces. Each member holds one of 5 roles. A key created in a workspace spends from the company wallet. Each workspace and each member can be given a monthly limit, in Toman and in requests; a key that reaches a limit answers 401 with code workspace_limit until the next month.
Last updated:
Company accounts and workspaces
- A company has one wallet and one plan of its own, separate from its members' personal wallets.
- A company is divided into workspaces (for example one per team or per product). Keys, usage and limits belong to a workspace.
- There is no limit on the number of members or workspaces.
- One user account can create up to 3 companies. An invitation to a new member is valid for 7 days.
A company is created and managed in the dashboard under Settings, Company (/settings/company, in Persian).
Roles
| Action | owner | admin | billing | developer | viewer |
|---|---|---|---|---|---|
| Read the usage report of a workspace it belongs to | owner:Yes | admin:Yes | billing:Yes | developer:Yes | viewer:Yes |
| Create and revoke workspace keys | owner:Yes | admin:Yes | billing:No | developer:Yes | viewer:No |
| Read company-wide usage | owner:Yes | admin:Yes | billing:Yes | developer:No | viewer:No |
| Top up, buy a plan, invoices and proformas | owner:Yes | admin:Yes | billing:Yes | developer:No | viewer:No |
| Set monthly limits for a workspace and its members | owner:Yes | admin:Yes | billing:Yes | developer:No | viewer:No |
| Create a workspace and set its budget | owner:Yes | admin:Yes | billing:No | developer:No | viewer:No |
| Invite and remove members, change roles, grant workspace access | owner:Yes | admin:Yes | billing:No | developer:No | viewer:No |
| Transfer ownership of the company | owner:Yes | admin:No | billing:No | developer:No | viewer:No |
A developer creates keys only in the workspaces it was given access to. Owners and admins have access to every workspace.
Workspace keys
- A workspace key has the same format as a personal key and works on the same routes.
- Its calls are paid from the company's wallet (and plan), not from the wallet of the person who created it. The creator is recorded beside each call.
- It can have an expiry and a spend cap, like any key (API keys and security).
- A key is re-checked on every request. When the workspace is deactivated or the company suspended, when its creator's membership stops being active, or when the creator no longer holds the owner, admin or developer role for that workspace, the key answers
401with codekey_revoked. - When an owner or admin removes a member, that member's keys are reassigned to the person who removed them and keep working.
The account API with a workspace key
On the account API a workspace key reads its own workspace only: that workspace's calls (every member's, from the API and from the chat product) and its keys, and of the company's wallet only the spendable balance (GET /v1/wallet/summary). The wallet ledger belongs to the whole company and is on the company dashboard; GET /v1/wallet/transactions with a workspace key answers 403 with code forbidden. Logged request and response text is returned only for calls made with an API key, never for what was written in the chat. A personal key, in turn, reads only the calls and keys outside company workspaces.
Monthly limits
| Limit | Applies to | Unit |
|---|---|---|
| Workspace monthly budget | Applies to:All spend of the workspace: API and chat together | Unit:Toman |
| Workspace monthly API limit | Applies to:Spend of the workspace's API keys | Unit:Toman |
| Workspace monthly chat limit | Applies to:Members' chat spend in the workspace | Unit:Toman |
| Workspace monthly request limit | Applies to:Number of requests of the workspace | Unit:Requests |
| Default per-member limit (API and chat) | Applies to:Every member without a limit of their own | Unit:Toman |
| One member's limit: API, chat, requests | Applies to:That member in that workspace | Unit:Toman and requests |
- An empty limit means no limit. No limit is set by default.
- A month is the Gregorian calendar month in UTC, and the counters reset at midnight UTC on the first day of the month.
- A member who has a request limit of their own is held to it, and the workspace's request limit is not checked for them.
- The request count covers every recorded call made with a key of that workspace.
When a limit is reached
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
{
"error": {
"message": "The workspace or member monthly usage limit has been reached.",
"type": "api_error",
"code": "workspace_limit"
}
}- A limit is checked before each call against the usage settled so far. The call that crosses the limit completes and is billed; the calls after it are refused.
- The key is not revoked: it works again when the next month starts, or when the limit is raised.
- This answer is a
401, not a402or a429; recognise it in your application by the codeworkspace_limit, not by the HTTP status.
Budget alerts
When a workspace's usage reaches 80% and then 100% of one of its monthly limits, the company's owners, admins and billing members get an email, each once a month.
Company top-ups and invoices
- The company wallet is topped up by owners, admins and billing members, with the same methods and the same 10% VAT described under billing.
- An invoice is issued for every successful payment. For a formal invoice, enter the company's legal name, national id, economic code, address and postal code in its billing profile.
- A proforma can be issued before paying.
1xAi is an independent gateway. It is not affiliated with, endorsed by, or a reseller for OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, Alibaba Qwen, MiniMax or Tencent Hunyuan. Requests are relayed upstream rather than answered by models of our own, so each provider's own usage policies apply to what their models will and will not do, and their model availability is theirs to change. Current reachability is published on the status page.