For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Key Management

Manage API Keys for all members in your organization: issue keys on behalf of members in three steps, restrict available models and RPM/TPM, disable and revoke keys, view last-used time; and how membe

An API Key lets an external system, script, MCP client, or AI Gateway call MaiAgent as a specific member. Each key is bound to one member and one organization, and calls made with it have exactly the same permissions as that member.

There are two places to manage keys:

  • Administrators: In Organization Settings → API Key Management, view all keys in the organization, issue keys on behalf of members, restrict available models and rate limits, and disable or revoke keys.

  • Members themselves: On the account page under API Keys, create and revoke their own keys. See Members Creating Their Own Keys.

Who Can Use It

Action
Requirement

Enter API Key Management; view, issue, disable, and revoke all keys in the organization

The API Key Management permission under the Organization Permissions role permission (organization owners have it by default; for how to configure it, see Edit Role Permissions)

Create and revoke your own keys on the account page

Any active member of the organization; no extra permission is needed

Set Provisioned Models, view this month's spending, and use Access Diagnostics

The organization has enabled AI Gateway

Key Concepts

  • The full key is shown only once: The full key is displayed when it is created. Once you close the dialog, you can no longer see it, and the list shows only the Prefix. If you lose it, revoke the old key and create a new one.

  • No limit on the number of keys: Each member can hold multiple active keys at the same time. When rotating keys, you can create the new key first, update your integration settings, and then revoke the old key, so service is not interrupted.

  • How to call: The platform API takes Authorization: Api-Key <key> in the HTTP header; the OpenAI-compatible endpoint of AI Gateway takes Authorization: Bearer <key>. For complete examples, see the technical manual's API Quickstart and AI Gateway: OpenAI-Compatible API Integration.

Key Sources

The Source column of the list shows who issued the key, and you can filter by it using Filter by Source:

Source
Description

System-issued

Created automatically by the system when a member joins the organization; the name is a string of member ID characters

Self-created

Created by the member on the account page

Admin-issued

Created for a member by an administrator in API Key Management; the issuer's name is shown below the tag

Key Statuses

Status
Description

Active

Can be used for calls normally

Disabled

Paused by an administrator; the key and its usage history are kept, and it can be re-enabled at any time

Expired

Past the configured expiration time

Revoked

Permanently invalid and cannot be restored

Disabled, expired, and revoked keys, as well as keys of members who have been removed, are rejected as invalid keys when used in calls.

How to Access

From the left menu, click Organization Settings → API Key Management. The list is sorted by creation time, newest first, with the columns Owner, Name, Prefix, Source, Status, Provisioned Models・Rate, Last Used, Expiration Time, and Created At.

  • The search box at the top searches by name, owner, or Email, and you can also filter by source and status.

  • Last Used is the most recent time the key passed authentication; it is updated at most once per minute for the same key. Keys that have never been used show -.

Create an API Key

Click Create API Key in the upper-right corner to open the three-step New API Key dialog.

1

Select a Member

In Select Member, search for and select the member the key will be bound to. The API Key Name is filled in automatically as "Member Name's API Key" and can be edited (up to 50 characters). After you select a member, the screen shows the number of models that member can reach.

If you do not need any restrictions, you can click Skip Settings and Generate Key directly: the key is created with default values (all reachable models enabled, no rate limit, never expires, enabled immediately). To set restrictions, click Next: Provisioning and Limits.

2

Provisioning and Limits

All of the following settings are optional, and they can also be adjusted in the key settings after creation:

Field
Purpose

Provisioned Models

The models this key can use when chatting through AI Gateway; all are selected by default. You can only narrow the selection within the "reachable" scope (models available to the organization and opened by the Gateway); it cannot exceed what the organization has available. It does not affect the Embedding endpoint

Requests Per Minute (RPM)

The number of platform API calls this key can make per minute. This counts not only AI Gateway but also regular platform API calls. Leave blank for no limit

Tokens Per Minute (TPM)

The number of Tokens this key can use per minute for inference through AI Gateway. It is calculated over fixed one-minute intervals, so a single request may push that minute's usage slightly over the limit, after which further requests in the same minute are rejected. Leave blank for no limit

Expiration Time

The time the key becomes invalid; leave blank for never expires

Enable immediately after creation

If unchecked, the key is "Disabled" after creation, and you can enable it when needed

If the organization has not enabled AI Gateway, Provisioned Models does not appear, and the other fields can still be set as usual. After you finish, click Generate Key.

3

Generate the Key

The screen shows the full key. Click the copy button to save it right away, then click Confirm and Close. After closing, you can no longer view the full key.

If you close the dialog before "Generate Key", the key may already have been created but the full key can no longer be displayed. Find the key in the list, revoke it, and create it again.

Manage Existing Keys

Each key has four actions on its right side:

Action
Description

Manage

Opens the Key Settings and Usage side panel (see below)

Access Diagnostics

Checks why this key cannot call a model, listing each check that failed (see AI Gateway Overview)

Disable / Enable

Pauses or resumes this key; takes effect immediately after confirmation

Revoke

Permanently stops this key and cannot be undone

The Key Settings and Usage side panel has two sections:

  • Key Settings: the Enabled switch, RPM, TPM, Expiration Time (blank = never expires), and Provisioned Models. After making changes, click Save; they take effect immediately.

  • Usage This Month: Spending This Month (credits), the bound member's Member Quota, and the Models Called・Spending breakdown. Spending and the model breakdown are shown only when the organization has enabled AI Gateway.

Choosing between disabling and revoking: If you only want to temporarily stop an integration from making calls (for example, to investigate abnormal traffic), use disable; you can re-enable it later. If you are sure the key will no longer be used or it has been leaked, use revoke.

Members Creating Their Own Keys

Members do not need administrative permissions to create a personal key for themselves:

  1. Click your avatar in the upper-right corner → Account.

  2. On the left, under the current organization name, click API Keys.

  3. Click Create Key (when you have no keys yet, the button is Create Your First Key), enter a Name, and optionally fill in an Expiration Time.

  4. After copying the full key shown on the screen, click Confirm and Close.

A personal key is created in the organization you are currently switched to, and it calls the API with your own identity and permissions. If you belong to multiple organizations, switch to the one you want to use before creating it.

This page lists only the keys you created yourself, and you can revoke keys whose status is Active. Keys issued to you by an administrator or automatically by the system are managed by the organization administrator in API Key Management. Members with the API Key Management permission see an Organization Key Management link at the top of this page, which takes them directly to the organization's key list.

Personal keys cannot set provisioned models or RPM/TPM on their own; if you need restrictions, ask an administrator to adjust them in API Key Management.

FAQ

Q: Can each member have only one active key?

No. Each member can hold multiple active keys at the same time, with no limit on the number.

Q: The API Key Management page opens blank?

Check in order:

  1. Your role has the API Key Management permission (see Who Can Use It); if you only want to create a key for yourself, use Members Creating Their Own Keys instead.

  2. Switch to the correct organization in the upper-left corner and refresh the page; if your browser has cached an old version of the page, force a refresh (Windows Ctrl+F5, macOS Cmd+Shift+R).

  3. If your company network or a browser extension blocks requests to the API domain, the list fails to load; try a different network or an incognito window.

If the page is still blank, send the error messages from your browser developer tools Console and your organization name to your MaiAgent contact.

Q: I forgot to copy the full key. What should I do?

The full key is shown only once, at creation, and the system cannot retrieve it again. Revoke this key and create a new one.

Q: Why can't I see the key an administrator created for me on my personal page?

The personal page shows only the keys you created yourself. For admin-issued and system-issued keys, ask an administrator with the API Key Management permission to view or revoke them.

Q: The Access Diagnostics button cannot be clicked?

Access diagnostics requires the organization to have AI Gateway enabled. When it is not enabled, the button shows "This organization has not enabled AI Gateway, so diagnostics are unavailable."; revoked keys also cannot be diagnosed.

Further Reading

Last updated

Was this helpful?