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

# Installation

Install the ScreenFramed CLI and configure environment variables for API usage.

ScreenFramed does not require an SDK. You can use any HTTP client. The CLI is available as `@screenframed/cli` for local capture workflows.

## CLI install

```bash
npm install -g @screenframed/cli
```

Or run it without installing:

```bash
npx @screenframed/cli login
```

## Environment variables

| Variable | Used by | Description |
|---|---|---|
| `SCREENFRAMED_API_KEY` | API and CLI | API key used for authenticated requests. |
| `SCREENFRAMED_API_BASE_URL` | CLI | Override the API base URL. Defaults to `https://screenframed.com`. |

## Local configuration

After `screenframed login`, the CLI stores a scoped key in your local ScreenFramed config file. For CI, use an explicit environment variable instead:

```bash
SCREENFRAMED_API_KEY="sf_live_..." screenframed capture https://example.com
```

**Do not commit keys**

API keys grant access to your account credits and scoped resources. Store them in your secret manager, CI variables, or local shell profile.

## Minimal API client

```javascript JavaScript
export async function createRender(payload) {
  const response = await fetch("https://screenframed.com/v1/capture", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SCREENFRAMED_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(await response.text());
  }

  return response.json();
}
```

```python Python
import os
import requests

def create_render(payload):
    response = requests.post(
        "https://screenframed.com/v1/capture",
        headers={"Authorization": f"Bearer {os.environ['SCREENFRAMED_API_KEY']}"},
        json=payload,
    )
    response.raise_for_status()
    return response.json()
```

## Validate your setup

```bash
curl "https://screenframed.com/v1/usage" \
  -H "Authorization: Bearer $SCREENFRAMED_API_KEY"
```

If the key is valid, the response includes your remaining credits, monthly credits, last 30 days usage, and daily breakdown.