Quickstart
Python
glim is plain HTTPS + JSON — requests or httpx is the whole integration. Add the x402 client if you want to pay per call from a wallet instead of an API key.
With an API key
Create a key at glim.sh/app and send it as an x-api-key header (or Authorization: Bearer):
requests — API key
import os
import requests
res = requests.post(
"https://glim.sh/api/v1/web/search",
headers={"x-api-key": os.environ["GLIM_API_KEY"]},
json={"query": "x402 protocol"},
)
print(res.json())Pay per call with a wallet
The x402 package wraps a requests session so a 402 response is paid automatically and retried — no account, no key. Fund the wallet with USDC on Base:
install
pip install "x402[requests,evm]"requests — wallet pays on 402
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients.requests import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import register_exact_evm_client
client = x402ClientSync()
register_exact_evm_client(
client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"]))
)
session = x402_requests(client)
res = session.post(
"https://glim.sh/api/v1/web/search",
json={"query": "x402 protocol"},
)
print(res.json())Every tool, same shape
Swap the path and body to reach any tool — twitter/search, reddit/get, web/fetch, github/search, and the rest. The OpenAPI spec carries typed schemas and a copy-pasteable example for each; the API reference renders them in the browser.