Authentication
The CLI needs your API key to make requests. There are three ways to provide it, listed in order of precedence.
Option 1: Login Command (Recommended)
Run rs login to save your API key to the config file:
rs login
Enter your API key: rs_live_xxxxx API key saved to ~/.config/renderscreenshot/config.json Authenticated as: My Team Plan: Growth Credits remaining: 11,482
Your key is stored locally and used for all subsequent commands.
Option 2: Environment Variable
Set RS_API_KEY in your shell or CI/CD environment:
export RS_API_KEY=rs_live_xxxxx rs take https://example.com
This overrides the config file and is ideal for CI/CD pipelines, Docker containers, and scripts.
CI/CD Examples
GitHub Actions:
- name: Take screenshot env: RS_API_KEY: ${{ secrets.RS_API_KEY }} run: rs take https://example.com --preset og_card -o screenshot.png
GitLab CI:
screenshot: script: - rs take https://example.com --preset og_card -o screenshot.png variables: RS_API_KEY: $RS_API_KEY
Option 3: Command Flag
Pass the key directly with --api-key:
rs take https://example.com --api-key rs_live_xxxxx
This overrides both the config file and environment variable. Useful for one-off commands or testing with a different key.
Signed URL Keys
To generate signed URLs, you also need your public key ID and secret key:
rs login --signed-urls
Enter your API key: rs_live_xxxxx Enter your public key ID: rs_pub_xxxxx Enter your secret key: rs_secret_xxxxx All keys saved to ~/.config/renderscreenshot/config.json
Or set them as environment variables:
export RS_API_KEY=rs_live_xxxxx export RS_PUBLIC_KEY_ID=rs_pub_xxxxx export RS_SECRET_KEY=rs_secret_xxxxx
View Current Status
rs whoami
Account: My Team Plan: Growth Credits: 11,482 remaining API Key: rs_live_...xxxxx (last 5 chars) Config: ~/.config/renderscreenshot/config.json
You can also view and manage individual config values with rs config:
rs config # Show all config rs config get api_key # Get a specific value rs config set api_key rs_live_xxx # Set a value
Logout
Remove stored credentials:
rs logout
Credentials removed from ~/.config/renderscreenshot/config.json
Config File Location
The config file is stored at:
| OS | Path |
|---|---|
| macOS / Linux | ~/.config/renderscreenshot/config.json |
| Windows | %APPDATA%\renderscreenshot\config.json |
You can override this with the RS_CONFIG_PATH environment variable:
export RS_CONFIG_PATH=/path/to/config.json
Config File Format
{ "api_key": "rs_live_xxxxx", "public_key_id": "rs_pub_xxxxx", "secret_key": "rs_secret_xxxxx" }