> ## 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.

# API overview

> Choose how to request data, authenticate with a Key, and read the result.

Use paid data from specialist Providers in your own application with one Glasser Key
and balance. There are two ways to request data: let Glasser select an Endpoint for
a supported task, or choose the Endpoint yourself.

## Choose how to request data

| | Solutions | Call an Endpoint directly |
| - | - | - |
| Start with | The data you need, such as a company profile. | A specific Provider and Endpoint. |
| Input | Glasser fields such as `domain` and `action`. | The Provider's input fields, from the Endpoint's schema. |
| Selection | Glasser selects an Endpoint; you can name a Provider. | You select the Endpoint and can inspect its Price before running it. |
| Best for | Common tasks in scripts and integrations. | Provider-specific features, input options, or control over the exact Endpoint. |
| Start here | [Solutions overview](/docs/api-reference/solutions/overview) | [Search Endpoints](/docs/api-reference/endpoints/search) → [inspect](/docs/api-reference/endpoints/inspect) → [run](/docs/api-reference/runs/create). |

For example, to get a profile for `glasser.ai`, a Solution accepts the domain and
handles the Provider selection and input format. To use a particular company's
data API with all its input options, inspect that Endpoint and call it directly.

Both paths create ordinary Runs and use the same Key, balance, and permissions.

## Authenticate

The API base URL is `https://api.glasser.ai`. Create a Key in
[Keys](https://app.glasser.ai/keys) and set it as `GLASSER_API_KEY` in your environment.
Send it in the `Authorization: Bearer` header.

Check your connection with this free balance request:

```bash theme={null}
curl --request GET \
  --url https://api.glasser.ai/v1/balance \
  --header "Authorization: Bearer $GLASSER_API_KEY"
```

Creating a Run, directly or through a Solution, also requires an `Idempotency-Key`
header. Keep the same value when retrying the same request. Use a new value for
a new execution.

## Read the result

A data request returns a **Run**. Its `provider`, `endpoint`, and `input` identify
what ran. The Provider's data is in `output`; `charge_usd` records the charge, and
`run_url` opens the Run in your Workspace.

Check `status` and `provider_response.http_status` before using the data. A
`COMPLETED` Run means Glasser received a usable Provider response; that response
can still report an error. A `202` response means the Run is still in progress:
use [Get run status and output](/docs/api-reference/runs/get) to retrieve the result.

See [How It Works](/docs/how-it-works) for Run states, pricing, and retries.


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