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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Get API usage

> Get Apollo API rate-limit consumption by provider endpoint.

`getApiUsage` returns current request limits and consumption for Apollo endpoint
groups.

```ts automations/get-apollo-api-usage.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { getApiUsage } from "automate.ax/apollo"

export default automation("Inspect Apollo API usage", () => {
  onHttpRequest({ scope: "automation" })
  getApiUsage({})
})
```

The only input is optional `account`. Returns `{ endpoints }`; every entry has
an `endpoint` key and optional `minute`, `hour`, and `day` windows containing
`consumed`, `remaining`, and `limit`. Apollo returns only windows applicable to
the connected plan and operation.
