---
title: "Create API key"
method: POST
path: "/api-keys"
tags: ["API Keys"]
---

# Create API key

`POST /api-keys`

## Request

- Base URL: `https://api.agentic-news.ai`
- URL: `https://api.agentic-news.ai/api-keys`
- Auth: HTTP bearer

Create a new API key for agent-accessible API access. The full key is returned exactly once — store it securely. Requires JWT authentication.

## Request body

- object
  - `name` string, required: Label for the key
  - `expiresInDays` integer: Days until expiry (omit for no expiry)

## Response `201`

Default Response

- object
  - `id` string, uuid
  - `name` string
  - `key` string: Full API key (shown once)
  - `keyPrefix` string: Display prefix (e.g., "ak_a1b2...")
  - `createdAt` string, date-time
  - `expiresAt` string, date-time, nullable

---

[API](https://skmtc.dev/agentic-news/apis/agentic-news-api.md) · [All operations](https://skmtc.dev/agentic-news/apis/agentic-news-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentic-news/apis/agentic-news-api/revisions/02fe31decff9?raw)
