> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-animate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Keys

> Create and manage API keys for programmatic access

API keys provide programmatic access to the Open Animate platform — use them in CI/CD pipelines, automated workflows, or any environment where browser login isn't practical.

## Create a key

```bash theme={null}
oanim api-keys create --name "ci-pipeline"
```

Output:

```
Name:   ci-pipeline
Prefix: anim_a1b2c3d4
Key:    anim_a1b2c3d4_e5f6g7h8i9j0k1l2m3n4o5p6

⚠ Save this key — it will not be shown again.
```

<Warning>
  The full key is only shown once at creation time. Store it securely.
</Warning>

## List your keys

```bash theme={null}
oanim api-keys list
```

Shows all your keys with name, prefix, creation date, and last-used date.

## Revoke a key

```bash theme={null}
oanim api-keys revoke <key-id>
```

Immediately invalidates the key. Any requests using it will fail.

## Using API keys

### Environment variable (recommended)

```bash theme={null}
export ANIMATE_API_KEY=anim_a1b2c3d4_e5f6g7h8...
oanim assets gen-image --prompt "gradient" --out bg.png
```

### CI/CD login

```bash theme={null}
oanim login --token $ANIMATE_API_KEY
```

This saves the key to `~/.oanim/credentials.yaml` so subsequent commands use it automatically.

### Resolution order

When making API calls, the CLI resolves credentials in this order:

1. `ANIMATE_API_KEY` environment variable
2. `api_key` in `~/.oanim/credentials.yaml` (saved by `oanim login`)

Set the env var in your CI secrets to avoid needing `oanim login` in pipelines.

## Key format

API keys use the `anim_` prefix followed by a short identifier and a secret:

```
anim_{8 chars}_{24 chars}
```

Only the prefix is stored on the server — the full key is hashed with SHA-256. This means if you lose it, you'll need to create a new one.

## Limits

Each account can have up to **10 API keys**. Revoke unused keys to make room for new ones.
