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

# API Reference

> Authenticate and call the Lightsage public API from your own integrations.

The Lightsage public API exposes the same contract used by the CLI. Use it to manage Visibility prompts, start eval runs, and work with API Performance resources from your own services and automation.

<Note>
  The public API uses API key authentication. It does not require browser login.
</Note>

## Base URL

All requests use this production base URL:

```text theme={null}
https://api.lightsage.com
```

<Warning>
  Use `https://api.lightsage.com` for API calls.
</Warning>

## Authenticate

Create an API key in the Lightsage dashboard:

1. Open **Settings > API Keys**.
2. Click **Create API key**.
3. Copy the key when it is shown.

Send the key on every authenticated request with the `X-Lightsage-Api-Key` header:

```bash theme={null}
curl https://api.lightsage.com/v1/auth/status \
  -H "X-Lightsage-Api-Key: ls_cli_your_api_key"
```

You can also store the key with the CLI and reuse the same credential for local testing:

```bash theme={null}
lightsage auth login
```

## Check API health

Verify that the public API is reachable:

```bash theme={null}
curl https://api.lightsage.com/v1/status
```

Check that your API key is valid:

```bash theme={null}
curl https://api.lightsage.com/v1/auth/status \
  -H "X-Lightsage-Api-Key: ls_cli_your_api_key"
```

## Explore endpoints

The sidebar groups endpoints by resource:

* **Status** — health and authentication checks
* **Prompts** — Visibility prompt and topic workflows
* **API Performance** — eval runs, sources, targets, skills, and related resources

Use the interactive playground on each endpoint page to send requests with your API key.

## CLI and SDK

The CLI is generated from this same OpenAPI contract. If you prefer command-line workflows, start with the [CLI Reference](/docs/cli-reference).

Download the raw OpenAPI spec from this docs site:

* [openapi.json](https://lightsage.com/docs/openapi.json)

For generated SDKs, see the [Lightsage OpenAPI repository](https://github.com/lightsagehq/openapi).
