---
title: "Save Api Key"
method: PUT
path: "/api/auth/api-key"
tags: ["auth"]
---

# Save Api Key

`PUT /api/auth/api-key`

## Request

- Base URL: `https://fojin.app` (the document declares no server; this is the origin it was published from)
- URL: `https://fojin.app/api/auth/api-key`
- Auth: HTTP bearer

保存用户自己的 API Key（加密存储）。

## Request body

- ApiKeyRequest
  - `api_key` string, required
  - `provider` string
  - `model` string, nullable
  - `custom_url` string, nullable

## Response `200`

Successful Response

- ApiKeyStatus
  - `has_api_key` boolean, required
  - `provider` string, nullable
  - `model` string, nullable
  - `key_preview` string, nullable
  - `custom_url` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform.md) · [All operations](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/revisions/969714238c61?raw)
