> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a key

> Create a KMS key with the Python SDK.

`client.kms.create_key()` creates an encryption key in a [KMS](https://infisical.com/docs/documentation/platform/kms/overview.md) project. The key stays in Infisical, so your application never holds it.

## Parameters

**name** `str` *required*

The name of the key, in lowercase letters, numbers, and hyphens.

**project\_id** `str` *required*

The ID of the KMS project.

**encryption\_algorithm** `SymmetricEncryption` *required*

`SymmetricEncryption.AES_GCM_256` or `SymmetricEncryption.AES_GCM_128`.

**description** `str`

A description of the key.

## Returns

**key** `KmsKey`

The new key, with its `id`, which the other KMS methods take as `key_id`.

```python Basic theme={"dark"}
from infisical_sdk import SymmetricEncryption

key = client.kms.create_key(
    name="payments-data",
    project_id="<project-id>",
    encryption_algorithm=SymmetricEncryption.AES_GCM_256,
)
```

```json Response theme={"dark"}
{
  "id": "8c9d0e1f-2a3b-4c4d-9e5f-6a7b8c9d0e1f",
  "name": "payments-data",
  "description": "",
  "projectId": "5e8d7c6b-4a3f-4e2d-9c1b-0a9f8e7d6c5b",
  "orgId": "2c1b0a9f-8e7d-4c6b-5a4f-3e2d1c0b9a8f",
  "encryptionAlgorithm": "aes-256-gcm",
  "version": 1,
  "isDisabled": false,
  "createdAt": "2026-12-02T11:20:08.774Z",
  "updatedAt": "2026-12-02T11:20:08.774Z"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.