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

# glasser run

> Run an Endpoint and retrieve its output.

## Usage

```bash theme={null}
glasser run -p <provider> -e <endpoint> [-i '<json>' | -f <file>]
```

Run an endpoint and pay for that one call. The idempotency key is generated and shown when omitted — retry an ambiguous failure with the same key and you get the original Run back instead of a second charge.

## Flags

| Flag | Description |
| - | - |
| `--provider, -p` | Provider slug (e.g. pdl) |
| `--endpoint, -e` | Endpoint key (e.g. /v5/person/enrich) |
| `--input, -i` | Provider-native input: inline JSON or @path/to/file.json |
| `--input-file, -f` | Read input from a JSON file (alternative to -i @file) |
| `--endpoint-version` | Select a supported Endpoint version (does not lock Price; 409 if unavailable or retired) |
| `--idempotency-key` | Reuse a key to retry safely; generated (and shown) when omitted |
| `--task` | Associate this Run with the `task_id` from a search response |
| `--wait, -w` | Poll until the Run is terminal |
| `--wait-timeout` | Seconds to wait before giving up (default 300; requires --wait) |
| `--output, -o` | Write the Run's output field to a file (COMPLETED with output only) |

## Wait for a result

Without `--wait`, an asynchronous Endpoint can return a `QUEUED` or `RUNNING`
Run. Use `--wait` to poll for a terminal status. `--wait-timeout` must be a
positive integer in seconds and defaults to `300`.

A wait timeout exits with code `1`; it does not stop the Run. Resume waiting
with `glasser runs get -r <runId> --wait`. Check `status`,
`provider_response.http_status`, and `charge_usd` separately.

Pass `--task` to keep the Run with its search and inspection. See
[keeping calls in one Task](/docs/cli#keep-calls-in-one-task).

See [CLI conventions](/docs/cli#global-flags) for global flags, JSON mode, exit codes, and environment variables.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.