---
title: "Update Api Key"
method: PUT
path: "/api/billing/api-key"
tags: ["billing", "billing"]
---

# Update Api Key

`PUT /api/billing/api-key`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/billing/api-key`
- Auth: none declared

Set/update user's Anthropic API key. Validates with Anthropic before saving.

## Request body

- ApiKeyUpdateRequest
  - `api_key` string, nullable

## Response `200`

Successful Response

- ApiKeyResponse
  - `is_set` boolean, required
  - `masked_key` string, nullable, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
