Skip to main content
POST
/
cloud
/
v3
/
inference
/
{project_id}
/
api_keys
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
inference_api_key_create = client.cloud.inference.api_keys.create(
    project_id=1,
    name="my-api-key",
)
print(inference_api_key_create.created_at)
{
  "created_at": "<string>",
  "deployment_names": [
    "<string>"
  ],
  "description": "This key is used for accessing the inference service.",
  "expires_at": "2024-10-01T12:00:00Z",
  "name": "<string>",
  "secret": "<string>"
}

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

Path Parameters

project_id
integer
required

Project ID

Body

application/json
name
string
required

Name of the API Key.

Required string length: 4 - 63
description
string

Description of the API Key.

Maximum string length: 300
expires_at
string

Expiration date of the API Key in ISO 8601 format.

Response

200 - application/json

OK

created_at
string
required

Timestamp when the API Key was created.

deployment_names
string[]
required

List of inference deployment names to which this API Key has been attached.

description
string | null
required

Description of the API Key.

Example:

"This key is used for accessing the inference service."

expires_at
string | null
required

Timestamp when the API Key will expire.

Example:

"2024-10-01T12:00:00Z"

name
string
required

API Key name.

secret
string
required

The actual API Key secret.