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

# Code examples

> Call the gHypurr API from cURL, JavaScript, and Python.

Store the key in `GHYPURR_API_KEY` on your own machine.

<CodeGroup>
  ```bash cURL theme={"dark"}
  export GHYPURR_API_KEY="YOUR_API_KEY"

  curl "https://ghypurr.com/api/v1/news?limit=20" \
    -H "Authorization: Bearer ${GHYPURR_API_KEY}"
  ```

  ```javascript JavaScript theme={"dark"}
  const response = await fetch("https://ghypurr.com/api/v1/ai-signals?limit=20", {
    headers: {
      Authorization: `Bearer ${process.env.GHYPURR_API_KEY}`,
    },
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(`${response.status} ${error.error}: ${error.message}`);
  }

  const page = await response.json();
  console.log(page.rows);
  ```

  ```python Python theme={"dark"}
  import os
  import requests

  response = requests.get(
      "https://ghypurr.com/api/v1/smart-wallets",
      params={"lane": "ready", "limit": 20},
      headers={"Authorization": f"Bearer {os.environ['GHYPURR_API_KEY']}"},
      timeout=20,
  )
  response.raise_for_status()
  print(response.json()["rows"])
  ```
</CodeGroup>

## Check usage

```bash theme={"dark"}
curl "https://ghypurr.com/api/v1/usage" \
  -H "Authorization: Bearer ${GHYPURR_API_KEY}"
```

## Production recommendations

* Set connection and response timeouts.
* Retry only transient `429` and `503` responses with bounded backoff.
* Record `X-Request-ID` for debugging, but never record the Authorization
  header.
* Cache responses according to your application's needs; API responses are
  returned as private, non-shared content.
* Rotate credentials without committing them to deployment files.
