---
title: "Save an encrypted AI provider token for use in sandbox containers."
method: POST
path: "/settings/agent-token"
tags: ["Agents"]
---

# Save an encrypted AI provider token for use in sandbox containers.

`POST /settings/agent-token`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/settings/agent-token`
- Auth: HTTP bearer

## Request body

- SaveAgentTokenRequest
  - `token` string, required: The OAuth token from `claude setup-token` or an API key. Will be encrypted before storage.

## Response `200`

Token encrypted and persisted

- SaveAgentTokenResponse
  - `saved` boolean, required

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Encryption or database error

## Changes

- **2026-04-25** `774be20905f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/settings/agent-token/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
