check_usage
Verify API rate-limit availability before or during work using provider headers or explicit remaining values, and prevent false blocks by returning a neutral proceed when no usage data is supplied.
Instructions
Pre-work / mid-work usage check.
Preferred path: pass the raw provider response headers dict and the
platform name; ATG will parse rate-limit fields. Alternatively pass
remaining_tokens / remaining_requests explicitly (host-extracted).
platform should name the actual provider ("openai" or "anthropic") when
headers is supplied — an omitted/unrecognized platform merges both
parsers instead of guessing OpenAI, so real Anthropic headers are never
silently misread as "no limit data" (which would report a false proceed
on an exhausted budget).
If neither headers nor remaining_* are provided, returns a neutral proceed signal so agents do not block.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headers | No | ||
| platform | No | ||
| low_threshold | No | ||
| estimated_tokens | No | ||
| remaining_tokens | No | ||
| remaining_requests | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||