---
title: "Create Api Key"
method: POST
path: "/v2/users/api_keys"
tags: ["api_keys"]
---

# Create Api Key

`POST /v2/users/api_keys`

## Request body

- CreateApiKeyRequest
  - `description` string, required
  - `expires_at` string, date-time, nullable — Expiry date for the API key
  - `project_id` string, uuid4, nullable
  - `project_role` 'owner' | 'editor' | 'annotator' | 'viewer'
  - `api_key` string, nullable — Optional pre-generated API key value. If not provided, one will be generated automatically. This is used for setups where the same API key needs to exist on multiple clusters.

## Response `200`

Successful Response

- CreateApiKeyResponse
  - `id` string, uuid4, required
  - `description` string, required
  - `expires_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `last_used` string, date-time, nullable
  - `project_id` string, uuid4, nullable
  - `project_role` 'owner' | 'editor' | 'annotator' | 'viewer'
  - `created_by` string, uuid4, required
  - `truncated` string, required
  - `api_key` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/galileo/apis/fastapi.md) · [All operations](https://skmtc.net/galileo/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/galileo/fastapi/versions/441b96da8c30/schema)
