Skip to main content
Search, inspect and run paid API endpoints with one Key — the same three calls as the API, from the terminal.

Install

Requires Node.js 22 or newer; npm is optional. Re-run either command to upgrade.

Authentication

Run this command to open browser sign-in and store a Key for your Workspace:
Approve only when the code in the browser matches the terminal. See glasser login for the login options. For CI and scripts, create a Key in the console and set GLASSER_API_KEY, or use glasser keys add.

Commands

Choose a command in the sidebar or open its reference below. Each command page lists its syntax and options.

Keep calls in one Task

A search returns a task_id. Pass that value with --task on related searches, including retries with different words and requests for the next page, and on inspect and run. The CLI does not store or reuse the Task automatically. Every search still requires --use-case, even when you pass --task.
Replace <taskId> below with the task_id from that response. Use the Provider, Endpoint, and input selected through search and inspection.
Omitting --task starts a new Task on each search. On inspect and run, omitting it leaves the call without a Task. On runs list, --task filters the results to that Task.

Global flags

Global flags on every command: -j/--json, --help, --version.

JSON mode

With -j/--json, command results on stdout are JSON. Stderr is empty on success and contains one JSON error object on failure. Explicit --help and --version requests still produce text.
  • run --json requires --idempotency-key so you can retry with the same key.
  • keys remove --json requires --force to skip interactive confirmation.
  • login --json is a usage error because login is interactive.
  • --output saves only the Run’s output field. On a successful write, stdout contains the full Run. A file write failure leaves stdout empty, writes an io_error JSON object to stderr, and exits 1. JSON mode does not print file status messages to stderr.
For run and runs get, a FAILED or STOPPED Run is still returned on stdout. The command also writes a JSON error to stderr and exits with code 1. Money amounts in Glasser response fields are exact decimal strings, never floats.

Exit codes

For run and runs get, exit 0 can mean that the Run is still QUEUED or RUNNING when you do not use --wait. A COMPLETED Run also exits 0 when the Provider returned HTTP 4xx or 5xx; check provider_response.http_status. The Run’s status and charge_usd are separate results. runs stop exits 0 when the stop request is accepted, even if the Run is still running. See stopping a Run for the full behavior.

Environment variables

For agents

The agent-facing Skill at glasser.ai/SKILL.md packages this CLI — when to use it, how to authenticate through glasser login, and the rules that keep spending deliberate. Point your agent at that file.