---
title: "Create User Api Key"
method: POST
path: "/agents/user/api-keys"
tags: ["agents"]
---

# Create User Api Key

`POST /agents/user/api-keys`

## Request

- Base URL: `https://studio-api.meganova.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://studio-api.meganova.ai/agents/user/api-keys`
- Auth: OAuth 2
  - Password
  - Token URL: `auth/token`

Create a new API key for BYOK.

## Request body

- UserAPIKeyCreate: Create a new API key.
  - `provider` string, required
  - `display_name` string, nullable
  - `api_key` string, required
  - `usage_limit_tokens` integer, nullable

## Response `200`

Successful Response

- UserAPIKeyResponse: API key response (without the actual key).
  - `provider` string, required
  - `display_name` string, nullable
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `api_key_prefix` string, nullable
  - `is_valid` boolean, required
  - `last_validated_at` string, date-time, nullable
  - `validation_error` string, nullable
  - `total_requests` integer, required
  - `total_tokens` integer, required
  - `usage_limit_tokens` integer, nullable
  - `is_active` boolean, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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