Docs / AI editors

Teach your AI editor QuotaStack

Install a rule once. Your IDE's AI assistant knows QuotaStack conventions in every future session — endpoint shapes, idempotency, which primitive to use, which pattern matches your product.

Each section below gives you the editor-specific file to install. Cursor supports one-click deeplinks; the others are copy-paste (we'll tell you exactly where the file goes). Same rule content across all of them — the only differences are frontmatter and file path.

Claude Code

Place at repo root. Claude Code loads CLAUDE.md automatically at session start.

Save to CLAUDE.md
Preview
# QuotaStack integration

This project integrates QuotaStack (credit-native billing platform, https://quotastack.io).

**When you need details about any concept, endpoint, or pattern, fetch the canonical docs.** Don't guess.

## Where to look

- Discovery index for agents: https://quotastack.io/llms.txt
- Any docs page has a raw-markdown counterpart at the same URL + `.md`.

Concepts (fetch `.md` for authoritative content):
- https://quotastack.io/docs/concepts/credits.md
- https://quotastack.io/docs/concepts/entitlements.md
- https://quotastack.io/docs/concepts/metering.md
- https://quotastack.io/docs/concepts/reservations.md
- https://quotastack.io/docs/concepts/topups-and-wallets.md
- https://quotastack.io/docs/concepts/subscriptions.md
- https://quotastack.io/docs/concepts/idempotency.md
- https://quotastack.io/docs/concepts/webhooks.md

Use cases — pick the one that matches the product, then read it:
- https://quotastack.io/docs/use-cases/saas-subscription.md — monthly tiered plans, rollover, topup packs
- https://quotastack.io/docs/use-cases/consumer-ai-subscription.md — prepaid tier with sub-monthly resetting quotas (ChatGPT Plus shape)
- https://quotastack.io/docs/use-cases/ai-chat-app.md — wallet + per-message metering + plan packs
- https://quotastack.io/docs/use-cases/ai-generation-app.md — packs + reserve/commit/release for async jobs
- https://quotastack.io/docs/use-cases/api-platform.md — postpaid metered with tiered pricing

## Invariants (non-negotiable)

1. **Every mutation carries an `idempotency_key`** — credit grants, debits, reservations, subscription changes, top-ups. Omitting it turns any network retry into a double-charge.
2. **Use the tenant's `external_customer_id`** in request bodies, not the QuotaStack UUID.
3. **Check entitlements before work, not after.** `GET /v1/entitlements/check` is sub-millisecond.
4. **Async/long-running operations use reservations**, never direct `/v1/usage`. Reserve → commit on success, release on failure.

For everything else — exact request shapes, burn order, webhook payloads, edge cases — read the relevant `.md` page. Docs are canonical.

VS Code + Copilot

Workspace-wide Copilot Chat instructions. Applies to every chat request in this repo.

Save to .github/copilot-instructions.md
Preview
# QuotaStack integration

This project integrates QuotaStack (credit-native billing platform, https://quotastack.io).

**When you need details about any concept, endpoint, or pattern, fetch the canonical docs.** Don't guess.

## Where to look

- Discovery index for agents: https://quotastack.io/llms.txt
- Any docs page has a raw-markdown counterpart at the same URL + `.md`.

Concepts (fetch `.md` for authoritative content):
- https://quotastack.io/docs/concepts/credits.md
- https://quotastack.io/docs/concepts/entitlements.md
- https://quotastack.io/docs/concepts/metering.md
- https://quotastack.io/docs/concepts/reservations.md
- https://quotastack.io/docs/concepts/topups-and-wallets.md
- https://quotastack.io/docs/concepts/subscriptions.md
- https://quotastack.io/docs/concepts/idempotency.md
- https://quotastack.io/docs/concepts/webhooks.md

Use cases — pick the one that matches the product, then read it:
- https://quotastack.io/docs/use-cases/saas-subscription.md — monthly tiered plans, rollover, topup packs
- https://quotastack.io/docs/use-cases/consumer-ai-subscription.md — prepaid tier with sub-monthly resetting quotas (ChatGPT Plus shape)
- https://quotastack.io/docs/use-cases/ai-chat-app.md — wallet + per-message metering + plan packs
- https://quotastack.io/docs/use-cases/ai-generation-app.md — packs + reserve/commit/release for async jobs
- https://quotastack.io/docs/use-cases/api-platform.md — postpaid metered with tiered pricing

## Invariants (non-negotiable)

1. **Every mutation carries an `idempotency_key`** — credit grants, debits, reservations, subscription changes, top-ups. Omitting it turns any network retry into a double-charge.
2. **Use the tenant's `external_customer_id`** in request bodies, not the QuotaStack UUID.
3. **Check entitlements before work, not after.** `GET /v1/entitlements/check` is sub-millisecond.
4. **Async/long-running operations use reservations**, never direct `/v1/usage`. Reserve → commit on success, release on failure.

For everything else — exact request shapes, burn order, webhook payloads, edge cases — read the relevant `.md` page. Docs are canonical.

Zed

No extension. Zed's Agent Panel auto-includes it in every conversation.

Save to .rules
Preview
# QuotaStack integration

This project integrates QuotaStack (credit-native billing platform, https://quotastack.io).

**When you need details about any concept, endpoint, or pattern, fetch the canonical docs.** Don't guess.

## Where to look

- Discovery index for agents: https://quotastack.io/llms.txt
- Any docs page has a raw-markdown counterpart at the same URL + `.md`.

Concepts (fetch `.md` for authoritative content):
- https://quotastack.io/docs/concepts/credits.md
- https://quotastack.io/docs/concepts/entitlements.md
- https://quotastack.io/docs/concepts/metering.md
- https://quotastack.io/docs/concepts/reservations.md
- https://quotastack.io/docs/concepts/topups-and-wallets.md
- https://quotastack.io/docs/concepts/subscriptions.md
- https://quotastack.io/docs/concepts/idempotency.md
- https://quotastack.io/docs/concepts/webhooks.md

Use cases — pick the one that matches the product, then read it:
- https://quotastack.io/docs/use-cases/saas-subscription.md — monthly tiered plans, rollover, topup packs
- https://quotastack.io/docs/use-cases/consumer-ai-subscription.md — prepaid tier with sub-monthly resetting quotas (ChatGPT Plus shape)
- https://quotastack.io/docs/use-cases/ai-chat-app.md — wallet + per-message metering + plan packs
- https://quotastack.io/docs/use-cases/ai-generation-app.md — packs + reserve/commit/release for async jobs
- https://quotastack.io/docs/use-cases/api-platform.md — postpaid metered with tiered pricing

## Invariants (non-negotiable)

1. **Every mutation carries an `idempotency_key`** — credit grants, debits, reservations, subscription changes, top-ups. Omitting it turns any network retry into a double-charge.
2. **Use the tenant's `external_customer_id`** in request bodies, not the QuotaStack UUID.
3. **Check entitlements before work, not after.** `GET /v1/entitlements/check` is sub-millisecond.
4. **Async/long-running operations use reservations**, never direct `/v1/usage`. Reserve → commit on success, release on failure.

For everything else — exact request shapes, burn order, webhook payloads, edge cases — read the relevant `.md` page. Docs are canonical.

AGENTS.md (universal)

Multi-editor convention — Copilot, Zed, and others auto-detect AGENTS.md at repo root. Good if you want one file that works across tools.

Save to AGENTS.md
Preview
# QuotaStack integration

This project integrates QuotaStack (credit-native billing platform, https://quotastack.io).

**When you need details about any concept, endpoint, or pattern, fetch the canonical docs.** Don't guess.

## Where to look

- Discovery index for agents: https://quotastack.io/llms.txt
- Any docs page has a raw-markdown counterpart at the same URL + `.md`.

Concepts (fetch `.md` for authoritative content):
- https://quotastack.io/docs/concepts/credits.md
- https://quotastack.io/docs/concepts/entitlements.md
- https://quotastack.io/docs/concepts/metering.md
- https://quotastack.io/docs/concepts/reservations.md
- https://quotastack.io/docs/concepts/topups-and-wallets.md
- https://quotastack.io/docs/concepts/subscriptions.md
- https://quotastack.io/docs/concepts/idempotency.md
- https://quotastack.io/docs/concepts/webhooks.md

Use cases — pick the one that matches the product, then read it:
- https://quotastack.io/docs/use-cases/saas-subscription.md — monthly tiered plans, rollover, topup packs
- https://quotastack.io/docs/use-cases/consumer-ai-subscription.md — prepaid tier with sub-monthly resetting quotas (ChatGPT Plus shape)
- https://quotastack.io/docs/use-cases/ai-chat-app.md — wallet + per-message metering + plan packs
- https://quotastack.io/docs/use-cases/ai-generation-app.md — packs + reserve/commit/release for async jobs
- https://quotastack.io/docs/use-cases/api-platform.md — postpaid metered with tiered pricing

## Invariants (non-negotiable)

1. **Every mutation carries an `idempotency_key`** — credit grants, debits, reservations, subscription changes, top-ups. Omitting it turns any network retry into a double-charge.
2. **Use the tenant's `external_customer_id`** in request bodies, not the QuotaStack UUID.
3. **Check entitlements before work, not after.** `GET /v1/entitlements/check` is sub-millisecond.
4. **Async/long-running operations use reservations**, never direct `/v1/usage`. Reserve → commit on success, release on failure.

For everything else — exact request shapes, burn order, webhook payloads, edge cases — read the relevant `.md` page. Docs are canonical.

What the rule does. It teaches your AI assistant the essentials of a QuotaStack integration: the canonical endpoint shape (/v1/customers/{id}/…), that idempotency_key is mandatory on every mutation, when to use reservations vs. direct usage events, and which of the five billing patterns matches the product you're building.

It also tells your AI where to look. Every docs page on this site has a raw Markdown counterpart at the same URL + .md. The discovery index is at /llms.txt. Your AI can fetch those directly.