Skip to content
GridRouterhome

Search

Search providers, capabilities and pages

Docs
Concepts

Execution options

One typed options object for timeouts, cost caps, cache, storage and logging, set per request, key, preset or workspace.

Every request that runs something (call, run, waterfall runs) accepts an options object. The same object is the default for a workspace (Settings → Options), for an API key, and on a preset.

{
  "input": { "domain": "example.com" },
  "options": {
    "timing": { "timeout_ms": 8000, "deadline_ms": 30000 },
    "cost": { "max_cost_micro": 50000 },
    "data": { "cache": { "mode": "prefer", "max_age_s": 604800 } },
    "observability": { "log_level": "metadata" }
  }
}

Precedence

Options merge leaf by leaf, later layers winning:

built-in defaults < workspace defaults < key defaults < preset < request (headers, then body)

Arrays and scalars replace; objects merge. The built-in defaults are cache prefer with writes on, stored records and bodies, sync delivery, and full logging with the live tail on.

Then the result is clamped to your plan:

PlanMax cache TTLMax concurrencyMax retriesMax deadline
Free30 days5260 s
Pro180 days253120 s
Team365 days1005300 s

log_level: none becomes metadata, because every call is metered. A workspace that keeps no bodies turns full into metadata.

POST /v1/options/resolve previews the result: the effective options, which layer set each leaf (sources) and every path that was lowered (clamped). Every call's log row stores the options it ran with.

Headers

HeaderOption
X-Grid-Max-Cost: 0.05cost.max_cost_micro (the header is in USD; 0.05 is 50,000 micro)
X-Grid-Preset: @slugrouting.preset
Idempotency-Key (8–128 of A-Z a-z 0-9 _ . : -)replays the first response for the same key and body
Cache-Control: no-storeskip the cache and do not write to it
Cache-Control: no-cacherefresh: call the vendor and overwrite the cached result
Cache-Control: only-if-cachedanswer from the cache or fail
Cache-Control: max-age=Naccept cached results up to N seconds old
Prefer: respond-async / Prefer: wait=Nasynchronous waterfall runs

Body options win over headers.

What takes effect today

OptionEffect
data.cache.*The private cache policy
data.store.records, data.store.bodiesfalse stops cache writes, or stops storing request and response bodies
data.fieldsFields returned by run and waterfall runs when the body sets none
timing.timeout_msPer-attempt vendor timeout; caps every waterfall step
timing.deadline_msDeadline for a whole run or waterfall run
timing.retry.max, timing.retry.base_ms, timing.hedge_after_msWaterfall step retries, backoff and hedging
concurrency.max_concurrencyParallel steps in a waterfall stage
cost.max_cost_microSpend cap for call, run and waterfall runs
routing.provider, routing.presetProvider preferences and preset for run
identity.metaMeta tags (≤ 16 keys, values ≤ 500 characters) when the body has none
observability.log_level, redact_fields, tailBody logging, masked keys, and whether the call shows on the live tail

Stored, not enforced yet

The schema also accepts rate, delivery.mode, cost.daily_cap_micro, cost.dry_run, timing.schedule and a few more. They validate, merge and are logged, and the editor marks them, but nothing acts on them yet.

The full JSON Schema is public at GET /v1/options/schema. Workspace defaults are GET / PUT /v1/options/defaults and a key's defaults are PUT /v1/keys/{id}/options.