---
title: "A new key for the same account; the key you send stops working at once. The credit stays with the account"
method: POST
path: "/api/credits/rotate"
tags: ["Pay over HTTP 402"]
---

# A new key for the same account; the key you send stops working at once. The credit stays with the account

`POST /api/credits/rotate`

## Request

- Base URL: `https://agentdrives.com`
- URL: `https://agentdrives.com/api/credits/rotate`
- Auth: API key in header `x-api-key`

## Response `200`

The new key, shown once, and the credit

- object
  - `api_key` string
  - `revoked` string
  - `credit` object: The account's credit after this call
    - `balance_cents` integer
    - `calls_left` integer
    - `expires_at` string, date-time, nullable
    - `paid_cents` integer: What this call took
    - `low` boolean: 50 calls left or fewer: time to top up
    - `topup` object: How to top up, when low

## Other responses

- `401`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next

---

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