## POST /v1/account/api-keys

Create an API key for your account. The response holds its secret, returned only this once. Only a GitHub administrator of your organization can create a key, and an API key cannot create another.

Required permissions: write:tokens.
API key: Requires a CLI user token belonging to an account administrator.
CLI user token: Requires an account administrator.
Session token: Not supported by session tokens, even with permissions.ellipsis enabled.
Higher permission levels include lower levels: read < write < delete.

### Request

```text
{
  "name": str
}
```

### Response

```text
{
  "api_key": {
    "created_at": str,
    "id": str,
    "last_used_at": str,
    "name": str,
    "revoked_at": str
  },
  "secret": str
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

result = client.account.api_keys.create("...")
print(result)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

const result = await client.account.apiKeys.create({ name: '...' });
console.log(result);
```

### cURL

```bash
curl -X POST "https://api.ellipsis.dev/v1/account/api-keys" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "..."
}'
```

### Request schema

```json
{
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}
```

### Response schema

```json
{
  "properties": {
    "api_key": {
      "properties": {
        "created_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "revoked_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "name",
        "created_at",
        "last_used_at",
        "revoked_at"
      ],
      "type": "object"
    },
    "secret": {
      "type": "string"
    }
  },
  "required": [
    "api_key",
    "secret"
  ],
  "type": "object"
}
```
