---
title: "List or create API keys"
method: POST
path: "/api/v1/keys"
tags: ["API Keys"]
---

# List or create API keys

`POST /api/v1/keys`

## Request

- Base URL: `https://api.muapi.ai`
- URL: `https://api.muapi.ai/api/v1/keys`
- Auth: one of:
  - API key in header `x-api-key`
  - OAuth 2 (client credentials, token URL `https://api.muapi.ai/oauth/token`)

Create a new API key for the authenticated user.

Pass ``"is_test": true`` in the JSON body to create a sandbox key that
never deducts credits and returns mock outputs.

Gated behind the `keys:manage` scope for OAuth-token callers (not plain
API keys or session logins) — otherwise a token minted with only e.g.
`generate:write` could mint itself a brand-new, permanent, unscoped API
key here and use that instead, silently escaping every scope restriction.

## Query parameters

- `team_id` integer, nullable

## Headers

- `x-api-key` string
- `x-embed-code` string, nullable
- `x-agent-embed-code` string, nullable
- `x-whitelabel-studio` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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