# AI API Key


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

API keys for accessing inference deployments.

[Read more](https://www.exoscale.com/ai-cloud-infrastructure/managed-inference/)

## <span data-label="POST" class="pill-POST"></span>create-ai-api-key

[BETA] Create AI API Key

```
POST /ai/api-key
```

Create a new AI API key

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | Human-readable name for the AI API key<br/><br/>Min length: `1`. Max length: `50`. |
| `scope` | string | **yes** | Key scope: 'public' for all deployments, or a specific deployment UUID |

<details>
<summary>Example</summary>

```json
{
  "name": "string",
  "scope": "string"
}
```
</details>


### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | Creation timestamp<br/><br/>ISO 8601 date-time. |
| `id` | string | AI API key ID<br/><br/>Must be a valid UUID. |
| `name` | string | Human-readable name for the AI API key |
| `org-uuid` | string | Organization UUID that owns this key<br/><br/>Must be a valid UUID. |
| `scope` | string | Key scope: 'public' for all deployments, or a specific deployment UUID |
| `updated-at` | string | Last update timestamp<br/><br/>ISO 8601 date-time. |
| `value` | string | Plaintext AI API key value |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "id": "string",
  "name": "string",
  "org-uuid": "string",
  "scope": "string",
  "updated-at": "2024-01-01T12:00:00Z",
  "value": "string"
}
```
</details>

**`400`**: Bad Request

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `create-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createAiApiKey(com.exoscale.sdk.model.CreateAiApiKeyRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-ai-api-key`

## <span data-label="GET" class="pill-GET"></span>get-ai-api-key

[BETA] Get AI API Key

```
GET /ai/api-key/{id}
```

Get AI API key metadata

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | Creation timestamp<br/><br/>ISO 8601 date-time. |
| `id` | string | AI API key ID<br/><br/>Must be a valid UUID. |
| `name` | string | Human-readable name for the AI API key |
| `org-uuid` | string | Organization UUID that owns this key<br/><br/>Must be a valid UUID. |
| `scope` | string | Key scope: 'public' for all deployments, or a specific deployment UUID |
| `updated-at` | string | Last update timestamp<br/><br/>ISO 8601 date-time. |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "id": "string",
  "name": "string",
  "org-uuid": "string",
  "scope": "string",
  "updated-at": "2024-01-01T12:00:00Z"
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `get-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getAiApiKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-ai-api-key`

## <span data-label="GET" class="pill-GET"></span>reveal-ai-api-key

[BETA] Reveal AI API Key

```
GET /ai/api-key/{id}/reveal
```

Reveal AI API key plaintext value

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `value` | string | Plaintext AI API key value |

<details>
<summary>Example output</summary>

```json
{
  "value": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `reveal-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.RevealAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reveal_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#revealAiApiKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reveal-ai-api-key`

## <span data-label="PATCH" class="pill-PATCH"></span>update-ai-api-key

[BETA] Update AI API Key

```
PATCH /ai/api-key/{id}
```

Update AI API key name and/or scope

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Human-readable name for the AI API key<br/><br/>Min length: `1`. Max length: `50`. |
| `scope` | string | no | Key scope: 'public' for all deployments, or a specific deployment UUID |

<details>
<summary>Example</summary>

```json
{
  "name": "string",
  "scope": "string"
}
```
</details>


### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | Creation timestamp<br/><br/>ISO 8601 date-time. |
| `id` | string | AI API key ID<br/><br/>Must be a valid UUID. |
| `name` | string | Human-readable name for the AI API key |
| `org-uuid` | string | Organization UUID that owns this key<br/><br/>Must be a valid UUID. |
| `scope` | string | Key scope: 'public' for all deployments, or a specific deployment UUID |
| `updated-at` | string | Last update timestamp<br/><br/>ISO 8601 date-time. |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "id": "string",
  "name": "string",
  "org-uuid": "string",
  "scope": "string",
  "updated-at": "2024-01-01T12:00:00Z"
}
```
</details>

**`400`**: Bad Request

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `update-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateAiApiKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-ai-api-key`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-ai-api-key

[BETA] Delete AI API Key

```
DELETE /ai/api-key/{id}
```

Delete AI API key

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `delete-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteAiApiKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-ai-api-key`


---

## Other Operations

## <span data-label="GET" class="pill-GET"></span>list-ai-api-keys

[BETA] List AI API Keys

```
GET /ai/api-key
```

List AI API keys for an organization

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `ai-api-keys` | array of [AI API key list entry](/reference/api/_schemas/list-ai-api-keys-response-entry/) |  |

<details>
<summary>Example output</summary>

```json
{
  "ai-api-keys": [
    {
      "created-at": "2024-01-01T12:00:00Z",
      "id": "string",
      "name": "string",
      "org-uuid": "string",
      "scope": "string",
      "updated-at": "2024-01-01T12:00:00Z"
    }
  ]
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `list-ai-api-keys`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListAIAPIKeys) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_ai_api_keys) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listAiApiKeys())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-ai-api-keys`

## <span data-label="POST" class="pill-POST"></span>rotate-ai-api-key

[BETA] Rotate AI API Key

```
POST /ai/api-key/{id}/rotate
```

Rotate AI API key value

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `value` | string | Plaintext AI API key value |

<details>
<summary>Example output</summary>

```json
{
  "value": "string"
}
```
</details>

**`403`**: Forbidden

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `rotate-ai-api-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.RotateAIAPIKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.rotate_ai_api_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#rotateAiApiKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api rotate-ai-api-key`

## <span data-label="GET" class="pill-GET"></span>get-user-org-consumption-quota

[BETA] Get Organization Consumption Quota

```
GET /ai/quota
```

Get per-org Unit Of Measurement (UOM) consumption quota (UOM/min). Null means unlimited. UOM represents weighted units across different AI workloads (e.g., tokens for LLMs, minutes for TTS, pages for OCR).

### Responses

**`200`**: OK

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `quota-uom-per-minute` | integer|null | Per-org Unit Of Measurement (UOM) consumption quota (UOM/min). Null means unlimited. UOM represents weighted units across different AI workloads (e.g., tokens for LLMs, minutes for TTS, pages for OCR).<br/><br/>Min: `0`. |

<details>
<summary>Example output</summary>

```json
{
  "quota-uom-per-minute": 0
}
```
</details>

**`404`**: Not Found

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `get-user-org-consumption-quota`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetUserOrgConsumptionQuota) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_user_org_consumption_quota) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getUserOrgConsumptionQuota())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-user-org-consumption-quota`


