# Screenshotlayer: agents start here

Steps for AI coding agents that add Screenshotlayer to a project.

## 1. Get an API key

A person creates the account: an agent cannot sign up. Sign up at https://app.apilayer.com/products/screenshotlayer?utm_source=productpage_screenshotlayer&utm_medium=internal and subscribe to Screenshotlayer. The Free plan includes 100 requests / month and needs no credit card.

Copy the API key from the APILayer dashboard and give it to the agent as an environment variable (step 2).

## 2. Keep the key out of code

Read the key from an environment variable named `APILAYER_ACCESS_KEY`. Do not write the key into source code, commit it to git, or paste it into a chat.

Call Screenshotlayer from server code. The key travels in the request URL, so a request sent from a browser shows the key to every visitor.

```
# add .env to .gitignore
APILAYER_ACCESS_KEY=your_api_key
```

## 3. Make the first request

- Base URL: `https://api.apilayer.com/screenshotlayer/api`
- Auth: `access_key` query parameter
- Formats: PNG, JPEG, GIF
- Endpoints:
  - `/capture` Capture

```sh
curl "https://api.apilayer.com/screenshotlayer/api/capture?access_key=$APILAYER_ACCESS_KEY&url=https://example.com"
```

## 4. Check the plan before you use a feature

Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.

| Plan | Requests / month | Adds |
|---|---|---|
| Free | 100 | Use: Non-commercial use, CDN support, Customization: Advanced customization, Free API access |
| Starter | 10,000 | Use: Commercial use, Customization: Full customization, Retina/2x support, WebP support up to 100% quality, Dedicated workers: 10, 256-bit HTTPS encryption, Support: Standard support, Overage support |
| Professional | 30,000 | Dedicated workers: 20, FTP & S3 export |
| Enterprise | 75,000 | Dedicated workers: 40 |

Prices: https://apilayer.com/products/screenshotlayer/#pricing

## 5. Use the machine-readable docs

- Screenshotlayer documentation: https://docs.apilayer.com/apilayer/docs/screenshotlayer?utm_source=productpage_screenshotlayer&utm_medium=internal
- APILayer llms.txt: https://apilayer.com/llms.txt
