# Batch Create API Key - BatchCreateUMInferAPIKey

## Introduction

Batch create API keys.

## Usage

You can initiate an API request using any of the following methods:
- Multi-language OpenSDK / [Go](https://github.com/ucloud/ucloud-sdk-go) / [Java](https://github.com/ucloud/ucloud-sdk-java) / [Python](https://github.com/ucloud/ucloud-sdk-python3) / [JavaScript](https://github.com/ucloud/ucloud-sdk-js) / [PHP](https://github.com/ucloud/ucloud-sdk-php) /
- [CloudShell Cloud Command Line](https://shell.ucloud.cn/)

## Definition

### Common Parameters

| Parameter Name | Type | Description | Required |
|:---|:---|:---|:---|
| **Action**     | string  | The corresponding API command name. For this API, it is `BatchCreateUMInferAPIKey`                        | **Yes** |
| **PublicKey**  | string  | User public key, which can be obtained from the [console](https://console.ucloud.cn/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on the public key and the API command. See [Signature Algorithm](https://docs.ucloud.cn/api/summary/signature)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [Region and Zone List](https://docs.ucloud.cn/api/summary/regionlist) |**Yes**|
| **Zone** | string | Zone. See [Region and Zone List](https://docs.ucloud.cn/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. Leave it blank for the default project. Sub-accounts must fill in. Please refer to the [GetProjectList API](https://docs.ucloud.cn/api/summary/get_project_list) |No|
| **Prefix** | string | Prefix name of key |**Yes**|
| **Start** | integer | Start number of key |**Yes**|
| **Count** | integer | Count of keys |**Yes**|
| **ModelverseDisabled** | integer | Is modelverse available? 0: Enabled 1: Disabled |No|
| **SandBoxDisabled** | integer | Is the sandbox available? 0: Enabled 1: Disabled (astraflow sandbox control is not yet launched and is temporarily invalid) |No|
| **DailyLimitAmount** | string | Daily limit, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **MonthlyLimitAmount** | string | Monthly limit, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **GrantAllModels** | boolean | All model access switches: when enabled, they are not controlled by the GrantedModels parameter; when disabled, only models added in GrantedModels can be accessed |No|
| **GrantedModels** | string | The authorization model is represented in an array format. When GrantAllModels is set to false, the current key can only access models in the array. For example: ["deepseek-ai/DeepSeek-V3.2-Think"] |No|
| **IPWhitelist** | string | IP whitelist, multiple sets of IPs separated by newlines. Supports IPv4 and network segments. Enter and press Enter to take effect. Up to 100 entries are allowed. Example:<br /><br />192.168.1.1<br />192.168.1.10-192.168.1.100<br />192.168.1.10/24 |No|
| **InferenceLogEnabled** | integer | Whether to enable inference logs 0: Disabled 1: Enabled |No|

### Response Fields

| Field Name | Type | Description | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. 0 indicates a successful return; non-0 indicates failure |**Yes**|
| **Action** | string | Operation command name |**Yes**|
| **Message** | string | Return error message. Provides detailed description when `RetCode` is non-0 |No|
| **Data** | array[*APIKey*](#apikey) | Key list |No|

#### Data Model

#### APIKey

| Field Name | Type | Description | Required |
|:---|:---|:---|:---|
| **IPWhitelist** | string | IP whitelist, multiple sets of IPs separated by newlines. Supports IPv4 and network segments. Enter and press Enter to take effect. Up to 100 entries are allowed. Example: ﻿ 192.168.1.1 192.168.1.10-192.168.1.100 192.168.1.10/24 |**Yes**|
| **InferenceLogEnabled** | int | Whether to enable inference logs |**Yes**|
| **DeniedModels** | array[string] | List of models that are not allowed to be accessed. Effective when ModelAccessMode=blacklist. |No|
| **ModelAccessMode** | string | Model access policy. Optional values: whitelist (whitelist mode, default) or blacklist (blacklist mode). |No|
| **KeyId** | string | Resource ID |No|
| **Name** | string | Name |No|
| **ChannelId** | int | Channel ID |No|
| **TopOrganizationId** | int | Company ID |No|
| **OrganizationId** | int | Project ID |No|
| **Status** | int | Status, 1 = Normal |No|
| **CreateTime** | int | Creation time |No|
| **Key** | string | Key value, showing the first four and last four characters with * masking in between |No|
| **ExpireTime** | int | Expiration time as a Unix timestamp, -1 means never expires |No|
| **ModelverseDisabled** | int | Is modelverse available? 0: Enabled 1: Disabled |No|
| **SandBoxDisabled** | int | Is the sandbox available? 0: Enabled 1: Disabled (astraflow sandbox control is not yet launched and is temporarily invalid) |No|
| **DailyLimitAmount** | string | Daily limit, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **DailyUsedAmount** | string | Daily used amount, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **MonthlyLimitAmount** | string | Monthly limit, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **MonthlyUsedAmount** | string | Monthly used amount, with the unit depending on the user's channel. For channel 126, the unit is USD |No|
| **GrantAllModels** | boolean | All model access switches: when enabled, they are not controlled by the GrantedModels parameter; when disabled, only models added in GrantedModels can be accessed |No|
| **GrantedModels** | array[string] | Authorized models, separated by English commas. "all" indicates permission for all models |No|
| **CreatorUserName** | string | Username of the key creator |No|
| **IsOwner** | int | Whether the key belongs to the user calling this API |No|

## Example

### Request Example
```
https://api.ucloud.cn/?Action=BatchCreateUMInferAPIKey
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=iXZbCebH
&Prefix=OLkgFDPC
&Start=6
&Count=5
&ModelverseDisabled=5
&SandBoxDisabled=7
&DailyLimitAmount=UgIsTmJi
&MonthlyLimitAmount=Jmacqfra
&GrantAllModels=true
&GrantedModels=fEZbqvkL
&IPWhitelist=jQJFgVUQ
```

### Response Example
```json
{
  "Action": "BatchCreateUMInferAPIKeyResponse",
  "Count": 3,
  "DailyLimitAmount": "fURAcSnH",
  "GrantAllModels": false,
  "GrantedModels": "qqHMiGDb",
  "IPWhitelist": "qimWFhke",
  "ModelverseDisabled": 5,
  "MonthlyLimitAmount": "puAvkNEH",
  "Prefix": "COehxXIT",
  "RetCode": 0,
  "SandBoxDisabled": 9,
  "Start": 1
}
```