Overview
This API is used to create a new AI API Key. The created API Key will belong to the specified organization and project.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/maas/apikeys
Request parameters
Header
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| Authorization | string | Yes | IAM authentication information. | -u ak:sk |
| requestId | string | No | Unique identifier of the request. | req-abc123 |
| X-Request-Id | string | No | Unique identifier of the request. | req-abc123 |
| X-OB-Org-Id | string | Yes | Organization ID, which is required for all APIs. | org-xxxxxxxx |
| X-OB-Project-Id | string | Yes | Project ID, which is required for all APIs. | proj-xxxxxxxx |
| X-Ob-Product | string | No | Source product identifier, which must be a supported product enumeration value when passed in. | - |
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| uid | string | No | Account ID, which is input from the network. If missing, INVALID_PARAMETER is returned. | - |
Body
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| name | string | Yes | The name of the API key. | my-api-key |
| action | string | Yes | Permission operations for API keys. | read |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| data | object | The returned data object. |
| data.apiKey | string | The value of the newly created API key. |
| data.name | string | The name of the API key. |
| data.createdAt | string | Creation time of the API key. |
| requestId | string | The unique identifier for this request. |
| server | string | The server address that processes the request. |
| success | boolean | Whether the request was successful. |
Examples
Request example
curl -X POST \
https://api-cloud.oceanbase.com/api/v2/maas/apikeys \
-H 'X-OB-Org-Id: org-xxxxxxxx' \
-H 'X-OB-Project-Id: proj-xxxxxxxx' \
-H 'Content-Type: application/json' \
-u '<Your AK:SK>' \
-d '{
"name": "my-api-key",
"action": "read"
}'
Response example
{
"data": {
"apiKey": "sk_xxxxxxxxxxxxxxxx",
"name": "my-api-key",
"createdAt": "2023-10-12T09:45:30Z"
},
"requestId": "xxxxxx",
"server": "xxx.xxx.x.xxx:xxxx",
"success": true
}
