> ## Documentation Index
> Fetch the complete documentation index at: https://www.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.

# Projects, apps, and environments

> How projects, apps, and environments fit together.

Your workspace holds projects (Groups of apps, usually one per codebase or product.). A project holds apps (A Compute app: a deployable service inside a project. Not 'your application' in general.). Every app has exactly two environments (A production or preview environment of a Compute app, not the dashboard label on a key.): production and preview. A deployment (One built and running version of an app in one environment.) belongs to one environment. Almost everything you configure (environment variables, gateway policies, the container's CPU) is set per environment.

**acme (workspace)**

**payments (project)**

**api (app, connected to acme/payments on GitHub)**

**production (environment)**

**build and runtime settings**

**environment variables**

**custom domains**

**gateway policies**

**deployments, one of them current**

**preview (environment)**

**its own settings, variables, policies, and deployments**

**worker (app, deployed from an image)**

**production and preview, same shape**

## Projects

A project is how you group apps. It has a name and a slug. The slug is what you pass to the API and the CLI, so it must be unique in your workspace. The slug `default` is reserved, so the API will return an error if you use it. A project can also carry delete protection, which blocks deletion until you turn it off. See [Delete protection](https://www.unkey.com/docs/platform/security/delete-protection.md).

Creating a project creates nothing else. There's no default app. In the dashboard, creating a project opens the new-app flow. The API returns the project alone. Unlike platforms where a project is itself what you deploy, here the project is only a folder.

In the dashboard, the project level holds things that span apps: runtime **Logs** and gateway **Requests** for every app in the project, plus **Project settings** (name and delete).

## Apps

An app is what you deploy. Two apps in one project build and deploy on their own. A monorepo with an API and a background worker is two apps on the same repository with different root directories. The project page lists apps. **Create app** adds another.

An app has a name, a slug unique within its project, and a source. The source is either a GitHub repository or a container image. The source kind is fixed when you create the app. For an image-sourced app, the dashboard's **Build** settings page shows only the image, because there's nothing to build.

For a git-connected app the tracked branch is `defaultBranch`, which defaults to the repository's default branch on GitHub. Pushes to that branch deploy to production. Every other branch deploys to preview. You can retarget the branch, replace the repository, or disconnect.

## Environments

Creating an app also creates its two environments: `production` with kind `production` and `preview` with kind `preview`. You can't add a third environment or delete either of these. The environment slug is what you pass to the API alongside the project and app slugs.

In the dashboard, **App settings** > **Environments** lists both environments. Each one opens a page with its compute (regions, size, instances, and storage), its domains, and, for a git-connected app, its tracked branch and auto-deploy switch.

The kind decides how deployments behave:

* `production` deployments serve the live domains, can be promoted and rolled back, and can't be stopped.
* `preview` deployments can be stopped and started and are stopped automatically when idle.

## Identifiers

Every Compute endpoint accepts either the ID or the slug for a project, app, or environment. A request looks like `project: payments, app: api, environment: production`, or uses the `proj_`, `app_`, and `env_` IDs the list endpoints return. The dashboard URL carries the IDs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.