---
title: "Create Api Key"
method: POST
path: "/auth/keys"
tags: ["Personal API Keys"]
---

# Create Api Key

`POST /auth/keys`

## Request body

- APIKeyCreate
  - `name` string, required
  - `scopes` string[], nullable
  - `resource_filters` object, nullable
  - `client_id` string, nullable
  - `host_id` string, nullable
  - `server_id` string, nullable
  - `agent_id` string, nullable
  - `display_label` string, nullable
  - `expires_at` string, nullable

## Response `201`

Successful Response

- APIKeyCreateResponse
  - `id` string, required
  - `user_id` string, required
  - `name` string, required
  - `client_id` string, nullable
  - `host_id` string, nullable
  - `server_id` string, nullable
  - `agent_id` string, nullable
  - `display_label` string, nullable
  - `issued_by_user_id` string, nullable
  - `created_from_client_id` string, nullable
  - `scopes` string[], required
  - `resource_filters` object, required
  - `created_time` string, required
  - `modified_time` string, nullable
  - `expires_at` string, nullable
  - `last_used_at` string, nullable
  - `is_active` boolean, required
  - `key` string, required — Raw API key — store securely, will not be shown again

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agience/apis/agience-platform-api.md) · [All operations](https://skmtc.net/agience/apis/agience-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agience/agience-platform-api/revisions/187bad270c94/schema)
