# LLMSTATS.BUCKET

> Create an LLM usage stats bucket, or confirm that it exists.

URL: https://docs.hotkv.com/commands/llmstats-bucket/

```
LLMSTATS.BUCKET name
```

- Group: LLM usage and budgets
- Complexity: O(1)
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the llm-stats license feature

LLM usage stats keep running totals of the requests, tokens, cost and latency of your model calls in named buckets, for example one per tenant or per model. `LLMSTATS.BUCKET` creates an empty bucket. It is safe to call on a
bucket that already exists, which is left unchanged. You do not have to call
it first: [LLMSTATS.RECORD](https://docs.hotkv.com/commands/llmstats-record/index.md) creates a missing bucket too.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Bucket created or already present | Simple string `OK` | Same |

Errors:

- `ERR bucket limit reached` if the bucket is new and the server already holds its maximum number of buckets (`max_buckets` under `[llmstats]`).
- `ERR wrong number of arguments for 'llmstats.bucket' command` if the argument count is wrong.
- `NOLICENSE llm-stats requires a HotKV license. Contact sales@hotkv.com` if your license does not include the `llm-stats` feature.

## Examples

```
127.0.0.1:6379> LLMSTATS.BUCKET tenant_acme
OK
127.0.0.1:6379> LLMSTATS.BUCKET tenant_acme
OK
```

## Compatibility

HotKV-only command. Redis and Valkey have no equivalent.

## See also

[LLMSTATS.RECORD](https://docs.hotkv.com/commands/llmstats-record/index.md), [LLMSTATS.GET](https://docs.hotkv.com/commands/llmstats-get/index.md), [LLMSTATS.RESET](https://docs.hotkv.com/commands/llmstats-reset/index.md), [LLMSTATS.DROP](https://docs.hotkv.com/commands/llmstats-drop/index.md), [LLMSTATS.LIST](https://docs.hotkv.com/commands/llmstats-list/index.md), [LLMSTATS.PRICE](https://docs.hotkv.com/commands/llmstats-price/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)