v1

latestOpenAPI 3.0.22026-08-062794201004.1 KB
Model Services API Keys (AI Data Plane)

Create API Key

Creates a new API Key for the specified region within an organization. API Key created for a region can be used to access all the models of that region for inferencing.

In order to access this endpoint, the provided API key must have at least one of the following roles:

  • Organization Owner

To learn more, see Organization, Project, and Database Access Overview.

post/v4/organizations/{organizationId}/aiServices/models/apiKeys

Request body

namestring required

Name of the Language Model API Key.

descriptionstring

Description of the Language Model API Key.

expirynumber float required

Expiry of the API key in number of days. Maximum value is 365 days.

allowedCIDRsstring[] required

List of IP addresses or CIDR blocks that are allowed to use this API key.

allowedModelsstring[]

List of allowed model IDs for this API key.

  • If empty or omitted, defaults to "*" (all models in the region).
  • Can be set to ["*"] explicitly for all models.
  • Can contain specific model IDs to restrict access to those models only.
regionstring required

The region where the API key will be created. The apikey created in a region can access all the models available in that region.

Example request

{
  "name": "MyLanguageModelAPIKey",
  "description": "API key for accessing GPT-4 models",
  "expiry": 180,
  "allowedCIDRs": [
    "192.168.1.0/24",
    "10.0.0.0/8"
  ],
  "allowedModels": [
    "5ca127fe-49da-4a6a-aef9-08393b97643f",
    "6db238gf-50eb-5b7b-bfg0-09404c08754g"
  ],
  "region": "us-east-1"
}

Response

Successfully created API Key.

idstring

Unique identifier for the Model API key.

tokenstring

Generated API key token (only returned during creation).

Example response

{
  "id": "60a95d98-8660-488c-a1e0-25b90e926a1e",
  "token": "cb_api_sk_1234567890abcdef"
}