Managing API keys
Managing API keys
Section titled “Managing API keys”An API key is the credential used when calling endpoint APIs, external endpoint APIs, and the Neutree control plane API.
An API key inherits the creator’s permissions in the corresponding workspace. When a user calls the above APIs, the platform authenticates based on the permissions inherited by the API key, while also recording access logs and usage statistics based on the API key.
Creating an API key
Section titled “Creating an API key”To achieve more granular control over permission management and usage tracking, it is recommended to create a separate API key for each AI application.
-
Log in to the Neutree management interface, click API key in the left navigation pane, then click Create on the right.
-
Select a Workspace for the API key and enter a Name. These cannot be edited after the API key is created.
-
(Optional) In the Limits section, configure usage limits for the API key.
Parameter Description Token quota Limits the total number of tokens this API key can use within the specified period. After setting the Token limit, you must select a Period. Leave blank to set no token quota. Requests per second (RPS) Limits the number of requests this API key can make per second. Leave blank to set no RPS limit. Requests per minute (RPM) Limits the number of requests this API key can make per minute. Leave blank to set no RPM limit. Max concurrent Limits the number of requests this API key can process simultaneously. Leave blank to set no concurrency limit. Allowed models Limits the models this API key can call. Leave blank to allow all models. If models are specified, ensure the model names match those provided by the endpoints or external endpoints. -
After confirming the configuration, click Create to complete creation.
Viewing API keys
Section titled “Viewing API keys”Log in to the Neutree management interface and click API Key in the left navigation pane. The API key list on the right shows all API keys, including each key’s status, usage, rate limits, and allowed models.
Click an API key name to view its details. On the API key details page, you can view the following information:
- Token quota consumption for the API key, including the amount used, total quota, and remaining quota in the current period.
- Access control configuration for the API key, including RPS, RPM, max concurrency, and allowed models.
- Request count, average latency, and success rate for the past 24 hours.
To view the access logs for this API key, click View call logs on the details page. The system will redirect you to the Viewing access logs page, with logs filtered by the current API key.
Editing an API key
Section titled “Editing an API key”After an API key is created, you can edit its usage limit configuration as needed.
-
Log in to the Neutree management interface, click the menu icon (…) in the API key list, and select Edit, or go to the API key details page.
-
Modify the settings in the Limits (optional) section as needed. For parameter descriptions, see Creating an API key.
-
After confirming the configuration, click Save to complete editing.
Disabling an API key
Section titled “Disabling an API key”Log in to the Neutree management interface, click the menu icon (…) in the API key list, and select Disable, or go to the API key details page and click Disable. After disabling an API key, it can no longer be used to call endpoint or external endpoint APIs.
Re-enabling an API key
Section titled “Re-enabling an API key”Log in to the Neutree management interface, click the menu icon (…) in the API key list, and select Enable, or go to the API key details page and click Enable. After re-enabling an API key, it becomes available again, and the original usage limit configuration is retained.
Deleting API keys
Section titled “Deleting API keys”You can delete one or more API keys at a time.
- Log in to the Neutree management interface, click the menu icon (…) in the API key list or details page, and select Delete; or select multiple API keys in the list and click Delete above the list.
- In the dialog that appears, confirm and click Delete. The selected API keys will be permanently deleted.