# Pay per call, or from a balance

glim works two ways: pay per call straight from a crypto wallet with no account, or top up a prepaid balance and use an API key. Same endpoints, same prices — pick whichever fits your agent.

## Pay per call with a wallet

An unpaid request gets an HTTP `402` challenge listing the price and accepted networks. Your client pays on-chain and retries — no signup. Pay with USDC on `Base`, `Solana`, or `Monad` (x402), or on `Tempo` (MPP). The `x402-proxy` CLI runs the whole 402 loop for you:

**REST — pay per call**

```
# Pay per call with a crypto wallet — no account, no key.
# x402-proxy reads the 402 challenge and auto-pays from your wallet.
npx x402-proxy https://glim.sh/api/v1/twitter/get/cascade_fyi

# Check your wallet balance any time
npx x402-proxy wallet
```

For MCP clients, the same proxy bridges a stdio server to the paid endpoint, so any wallet-paying agent can connect:

**MCP — pay per call**

```
# Same wallet, for MCP clients — bridges stdio to the paid endpoint
npx x402-proxy mcp https://glim.sh/mcp
```

> **Nothing is hardcoded** Clients call first, read the live `402` challenge, then pay — so you always pay the current price for the current network. If glim ever moves hosts, only the URL changes.

## Prepaid balance & API key

Prefer not to attach a wallet per call? Sign in at `glim.sh/app`, top up a balance, and create an API key. Send it as an `x-api-key` header (or `Authorization: Bearer`) on REST, or connect the MCP server over OAuth — calls are billed against your balance:

**REST — 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"}'
```

## Full API reference

Every endpoint, parameter, and example response lives in the machine-readable spec:

- [Interactive API reference](https://glim.sh/docs-openapi) — browse and try every endpoint in the browser
- [OpenAPI spec](https://glim.sh/openapi.json) — the raw OpenAPI 3.1 document for codegen and tooling
- [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)
