---
title: "Rotate Agent Runtime Key"
method: POST
path: "/v1/agents/{agent_id}/api-key"
tags: ["sdk-v1"]
---

# Rotate Agent Runtime Key

`POST /v1/agents/{agent_id}/api-key`

## Path parameters

- `agent_id` integer, required

## Response `200`

Successful Response

- RuntimeKeyResponse — Runtime API key returned once after creation or rotation.
  - `full_key` string, required
  - `key_prefix` string, required
  - `created_at` string, date-time, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-06-13** `33e4ba4936ad` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/xorbitsai/apis/xagent/changes/v1/agents/:agent_id/api-key/post.md)

---

[API](https://skmtc.dev/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.dev/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
