from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
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": "2023-10-01T12:00:00Z",
"deployment_names": [
"inference-1",
"inference-2"
],
"description": "This key is used for accessing the inference service.",
"expires_at": "2024-10-01T12:00:00Z",
"name": "my-api-key",
"secret": "qLyjWDarjtT1zdp7dc"
}
This endpoint creates a new API key for everywhere inference. It returs api key’s actual secret only once after creation.
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
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": "2023-10-01T12:00:00Z",
"deployment_names": [
"inference-1",
"inference-2"
],
"description": "This key is used for accessing the inference service.",
"expires_at": "2024-10-01T12:00:00Z",
"name": "my-api-key",
"secret": "qLyjWDarjtT1zdp7dc"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
1
OK
The response is of type object
.
Was this page helpful?