POST
/
cloud
/
v2
/
inference
/
api_keys
Create API Key
curl --request POST \
  --url https://api.gcore.com/cloud/v2/inference/api_keys \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "description": "My first key",
  "expires_at": "2024-08-22T11:21:00Z",
  "inference_instance_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "name": "my-key",
  "project_id": 1
}'
{
  "created_at": "2022-01-01T00:00:00Z",
  "description": "My first key",
  "expires_at": "2024-08-22T11:21:00Z",
  "inference_instance_ids": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "key_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "my-key",
  "project_id": 1,
  "secret": "my-secret",
  "status": "ACTIVE"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Body

application/json
name
string
required

API key name.

Required string length: 1 - 200
Examples:

"my-key"

description
string | null

API key description.

Examples:

"My first key"

expires_at
string | null

Expiration date for the API key in ISO 8601 format.

Examples:

"2024-08-22T11:21:00Z"

inference_instance_ids
string[]

Inference instance IDs to bind to the API key.

Examples:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
project_id
integer | null

Project ID.

Examples:

1

Response

API Key

created_at
string<date-time>
required

API key creation date in ISO 8601 format.

Examples:

"2022-01-01T00:00:00Z"

key_id
string<uuid>
required

API key ID.

Examples:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

name
string
required

API key name.

Required string length: 1 - 200
Examples:

"my-key"

secret
string
required

API key secret.

Examples:

"my-secret"

status
string
required

API key status.

Examples:

"ACTIVE"

description
string | null

API key description.

Examples:

"My first key"

expires_at
string | null

Expiration date for the API key in ISO 8601 format.

Examples:

"2024-08-22T11:21:00Z"

inference_instance_ids
string[]

Inference instance IDs to bind to the API key.

Examples:
["3fa85f64-5717-4562-b3fc-2c963f66afa6"]
project_id
integer | null

Project ID.

Examples:

1