# REST API in one curl

Every glim tool is a plain HTTPS endpoint under `glim.sh/api/v1` — no SDK required. Pick an auth mode and make your first call in under a minute.

## With an API key

Sign in at `glim.sh/app`, top up a balance, and create an API key. Send it as an `x-api-key` header:

**curl — x-api-key**

```
# Prepaid balance: top up at glim.sh/app, then send your key
curl -X POST https://glim.sh/api/v1/web/search \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"x402 protocol"}'
```

The same key also works as a bearer token, if your HTTP client speaks `Authorization` more naturally:

**curl — bearer**

```
curl -X POST https://glim.sh/api/v1/web/search \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"x402 protocol"}'
```

## Pay per call with a wallet

No account at all: an unpaid request returns HTTP `402` with the price and accepted networks, your client pays on-chain and retries. The `x402-proxy` CLI runs that loop around any request:

**x402-proxy — pay per call**

```
# GET — auto-pays the 402 challenge from your wallet
npx x402-proxy https://glim.sh/api/v1/twitter/get/cascade_fyi

# POST with a JSON body
npx x402-proxy --method POST --header "Content-Type: application/json" \
  --body '{"query":"x402 protocol"}' https://glim.sh/api/v1/web/search

# Wallet address + balance
npx x402-proxy wallet
```

> **Prices are never hardcoded** Clients read the live `402` challenge before paying, so you always pay the current price.

## Responses & schemas

- [Interactive API reference](https://glim.sh/docs-openapi) — browse and try every endpoint
- [OpenAPI spec](https://glim.sh/openapi.json) — typed request and response schemas for codegen
- [llms.txt](https://glim.sh/llms.txt) — a compact, agent-readable index of tools, prices, and the payment flow

---

## All docs pages


**Get started**

- [Introduction](https://glim.sh/docs.md?page=introduction)
- [MCP quickstart](https://glim.sh/docs.md?page=quickstart)
- [REST API quickstart](https://glim.sh/docs.md?page=quickstart-rest)
- [JavaScript quickstart](https://glim.sh/docs.md?page=quickstart-js)
- [Python quickstart](https://glim.sh/docs.md?page=quickstart-python)
- [Payments & auth](https://glim.sh/docs.md?page=payments)

**Tools**

- [Twitter / X](https://glim.sh/docs.md?page=twitter)
- [Reddit](https://glim.sh/docs.md?page=reddit)
- [Web](https://glim.sh/docs.md?page=web)
- [GitHub](https://glim.sh/docs.md?page=github)
- [Amazon](https://glim.sh/docs.md?page=amazon)
- [YouTube](https://glim.sh/docs.md?page=youtube)
- [Telegram](https://glim.sh/docs.md?page=telegram)

**Reference**

- [Changelog](https://glim.sh/docs.md?page=changelog)
- [API reference](https://glim.sh/docs-openapi)
- [OpenAPI spec](https://glim.sh/openapi.json)
