# Create Service Account Key

Source: https://agenta.ai/docs/reference/api/create-service-account-key

`POST /service-accounts/{service_account_id}/keys/`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Create a key that acts as the service account. `value` is the raw key,
returned only here.

## Parameters

- `service_account_id` (in path, string (uuid), required)

## Response schemas

### 200: Successful Response

- `count` (integer) Default: `0`.
- `api_key` (object, nullable)
  - `id` (string (uuid), required)
  - `prefix` (string, required)
  - `created_at` (string (date-time), nullable)
  - `expires_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
- `value` (string, nullable)

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
