> ## 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.

# unkey healthcheck

> Probe a URL and exit non-zero unless it answers 200, for scripts and CI.

Send one HTTP GET request to a URL and exit 0 if the server answers 200, or exit 1 otherwise. The command needs no root key and never contacts the Unkey API. Use it as a small probe for CI pipelines, load balancer checks, and monitoring scripts, for example against the hostname of a deployment.

## Usage

```bash theme={"system"}
unkey healthcheck <url>
```

The URL is required. Without it, the command exits 1 with `you must provide a url like so: 'unkey healthcheck <url>'`. The command has no flags.

## Behavior

Redirects are followed and there's no request timeout, so a server that never answers keeps the command waiting. A 200 response prints `✓ Healthcheck passed: <url> returned 200` and exits 0. Any other status exits 1 with `healthcheck failed with status code <code>`. A connection error exits 1 with `failed to perform healthcheck:` followed by the underlying error.

## Examples

Probe a deployment hostname:

```bash theme={"system"}
unkey healthcheck https://payments-payments-api-production-acme.unkey.app/health
```

Alert when a service is down:

```bash theme={"system"}
unkey healthcheck https://example.com/api/status || echo 'Service is down!'
```

Gate a pipeline step:

```bash theme={"system"}
unkey healthcheck http://localhost:8080/health && npm test
```
