# API keys

Create, limit, copy, rotate, block and revoke API keys.

Open the API keys page in the console. One account can have up to 100 keys by default.

## Creating a key

Fill in the settings and press Create. The key shows once on screen so you can copy it.

| Setting | Meaning |
|---|---|
| Name | For you to recognise it in the list and on the Usage page |
| Expiry | Optional. After that day the key is rejected |
| Limit models | Optional. Pick models from a searchable picker; you do not type ids. The key may only use the chosen models |
| Spending limit (Rp) | Optional. See the note below |

## Managing keys

- **Copy**: while a key is active you can copy it again from the list. A blocked or expired key cannot be copied.
- **Edit**: change the name, expiry, model limits or spending limit.
- **Block and Unblock**: stop a key for a while without deleting it.
- **Rotate**: the key secret is replaced. The old key stops working at once, other settings stay. Replace the key in every application that uses it.
- **Revoke**: the key is deleted for good and cannot be recovered.

## Last used

The key list shows a **Last used** column: the time of the last request made with that key. A key that was never used shows a dash. The time is updated with a short delay, so it is not accurate to the second.

## Spending limit

The limit in rupiah per key only limits **balance** spending. It does not limit usage paid by a plan allowance. It is also not a [rate limit](https://sivcloud.com/en/docs/rate-limits/).

A key rejected because it was revoked, blocked or expired is answered with `invalid_api_key`. See [Authentication](https://sivcloud.com/en/docs/authentication/).
