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

> ## Agent Instructions
> Unkey is two separate products. Compute builds, deploys, and runs apps behind a gateway. API Management issues API keys, enforces rate limits, manages identities and permissions, and reports usage. Say which product a page belongs to; a reader can use either without the other.
> Every Unkey API endpoint is an HTTP POST to https://api.unkey.com/v2/{service}.{procedure} with a root key in the Authorization: Bearer header. Root keys are workspace scoped.
> Error codes have the form err:{system}:{category}:{specific} and each has a page at /errors/{system}/{category}/{specific}.
> The word environment means production or preview in Compute. Rate limiting has four meanings on this site; the glossary lists them.

# Cookbook

> Recipes for rate limiting, billing, and framework middleware built on Unkey.

Each recipe solves one common problem from start to finish. They assume you already have a keyspace, a root key, and a request handler that calls `keys.verifyKey`. If you don't yet, start with a [framework guide](/docs/api-management/guides/nextjs).

<Columns cols={2}>
  <Card title="Per-user rate limits" href="/docs/api-management/cookbook/per-user-rate-limit" icon="user-clock">
    Share one limit across all of a user's keys with identities, and give tiers different limits with overrides.
  </Card>

  <Card title="Per-endpoint rate limits" href="/docs/api-management/cookbook/endpoint-rate-limit" icon="route">
    Separate budgets for reads and writes, with named key limits or a namespace per route.
  </Card>

  <Card title="Usage-based billing with credits" href="/docs/api-management/cookbook/usage-billing" icon="coins">
    Meter requests with credits, refill monthly, charge more for heavy operations, and sell top-ups.
  </Card>

  <Card title="Tiered subscriptions" href="/docs/api-management/cookbook/tiered-subscriptions" icon="layer-group">
    Encode free, pro, and enterprise plans in a key's limits, credits, permissions, and metadata, and change plans in place.
  </Card>

  <Card title="Go middleware for net/http, Gin, and Echo" href="/docs/api-management/cookbook/go-middleware" icon="golang">
    Drop-in authentication middleware for the three common Go HTTP stacks.
  </Card>

  <Card title="FastAPI authentication" href="/docs/api-management/cookbook/fastapi-auth" icon="python">
    A typed FastAPI dependency with permission checks and rate limit headers.
  </Card>
</Columns>
