---
title: "Create an API key"
method: POST
path: "/v1/developer/keys"
tags: ["Developer account"]
---

# Create an API key

`POST /v1/developer/keys`

## Request

- Base URL: `https://api.memestack.ai`
- URL: `https://api.memestack.ai/v1/developer/keys`
- Auth: HTTP bearer

Creates a key and answers its secret ONCE — only its hash is stored. At most 10 active keys per account; 10 creations an hour. Session-authenticated (fresh account check); private, no-store.

## Request body

- object
  - `name` string, required
  - `publisher_only_default` boolean: true = this key's /v2/search and /v2/featured calls return only publisher charts (Our World in Data, USDA ERS, Eurostat, EEA) unless a call sends publisher_only itself. A JSON boolean; anything else is 400 INVALID_PUBLISHER_ONLY_DEFAULT.

## Response `201`

The key and its secret (shown once).

- object
  - `key` DeveloperApiKey
    - `id` string, uuid
    - `name` string
    - `prefix` string: The first 12 characters — the only part of a key ever shown again.
    - `created_at` string, date-time
    - `last_used_at` string, date-time, nullable
    - `revoked_at` string, date-time, nullable
    - `publisher_only_default` boolean: true = /v2/search and /v2/featured with this key return only charts imported from a licence-clean publisher (Our World in Data, USDA ERS, Eurostat, EEA) unless the call sends publisher_only itself (publisher_only=false overrides it). Off by default; set it on create or with PATCH /v1/developer/keys/{id}.
    - `calls_today` integer
    - `calls_30d` integer
  - `secret` string

## Other responses

- `400`: INVALID_NAME or INVALID_PUBLISHER_ONLY_DEFAULT.
- `401`: Not signed in.
- `404`: The developer API is dark.
- `409`: KEY_LIMIT — 10 active keys already.

---

[API](https://skmtc.dev/memestack/apis/memestack-api.md) · [All operations](https://skmtc.dev/memestack/apis/memestack-api/llms.txt) · [OpenAPI document](https://skmtc.dev/memestack/apis/memestack-api/revisions/9d3a19565f75?raw)
