This endpoint returns strategy quota headers on
every response (success and the 403 thrown when the quota is exceeded),
so clients can render quota state without an extra round-trip.
Pass an Idempotency-Key: <string> header to make retries safe — the server
caches the response for 24 hours and replays it on subsequent requests with
the same key. Cached replays do not run a new LLM job and do not consume
additional quota.
Scenario
Result
First request with a given key
Runs normally; response cached for 24h
Retry with same key + same body
Returns cached response with Idempotent-Replayed: true header
Retry with same key + different body
422 Idempotency-Key reused with a different request body.
Retry while the original is still running
409 Idempotent request still in progress. Retry shortly. plus Retry-After: 5
No header sent
No change in behavior — existing clients are unaffected
Notes:
Keys are scoped per user / API key, so two accounts cannot collide on the same string.
Use a client-generated unique value (e.g. uuidgen, or a stable hash of URL + description + run-id). Two semantically-equivalent retries must reuse the same key.
Pair this with your own retry-on-5xx logic to avoid duplicate strategies (and quota burn) on transient timeouts.
curl -X POST https://api.meter.sh/api/strategies/generate \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://news.ycombinator.com", "description": "Extract post titles and scores", "name": "HN Front Page" }'
Idempotent retry — first call runs, second call replays the cached response:
KEY=$(uuidgen)# First request — runs normally, returns the new strategy.curl -X POST https://api.meter.sh/api/strategies/generate \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -d '{ "url": "https://news.ycombinator.com", "description": "Extract post titles and scores", "name": "HN Front Page" }'# Retry with the same key + same body — replays the cached response.# Response includes the header `Idempotent-Replayed: true`. No quota is consumed.curl -X POST https://api.meter.sh/api/strategies/generate \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -d '{ "url": "https://news.ycombinator.com", "description": "Extract post titles and scores", "name": "HN Front Page" }'
The same Idempotency-Key is also honored on POST /api/strategies/generate/stream.
This applies independently to both filter_config and output_schema. To clear only one, send null for that field and omit the other.
Behavior change. Earlier versions of this endpoint cleared filter_config
when it was omitted from the request body. The endpoint now treats omission as
“leave unchanged” — consistent with standard PATCH semantics. If you were
relying on the old behavior, send "filter_config": null explicitly to clear.
Every response from a strategy-creation endpoint includes headers describing
the caller’s current standing against the rolling 30-day strategy quota.
These ride on successful responses and on the 403 thrown when the quota
is exceeded, so a client can render quota state from any creation call
without an extra round-trip.
Header
Value
Notes
X-Strategy-Quota-Used
Integer
Strategies counted in the rolling 30-day window. Counts both currently-active strategies and strategies created-then-deleted in the window.
X-Strategy-Quota-Limit
Integer
Plan limit. -1 means unlimited (enterprise).
X-Strategy-Quota-Reset
ISO 8601 UTC timestamp
When the next quota slot frees (oldest counted strategy + 30d). Omitted for unlimited plans and when no strategies have been counted yet.
X-Strategy-Quota-Tier
free | hobby | pro | enterprise
The plan tier used to compute the limit.
These headers are emitted by:
POST /api/strategies/generate
POST /api/strategies/generate/stream
POST /api/watch
For a pure read of the same numbers without making a creation call, use
GET /api/account/quota.
Paginated audit log of strategy create and delete events, merged into a
single timeline (most recent first).
GET /api/strategies/audit
The endpoint merges three event sources:
created events from currently-active strategies
created events from previously-deleted strategies (created within the window, then deleted)
deleted events
All created events have counted_against_quota: true (every created
strategy consumed one slot of the rolling 30-day quota, whether or not it
was later deleted). deleted events have counted_against_quota: false —
they are tracking-only and do not consume quota.
Compare a manifest of known items against the latest scrape results for a strategy. This is a convenience endpoint that automatically uses the most recent completed job.
POST /api/strategies/{strategy_id}/compare-manifest