OPTINROUTER / DEVELOPER DOCS

Context actions & parallel execution

Policy-approved triggers can enrich, filter or transform a flow and run additional checks before or after inference.

Contract preview · Production API access is closed. All /v1 endpoints currently return 401.Install CLI
01

Inline stages and parallel branches

Inline steps run in a defined order and can transform the main flow. Parallel branches receive only declared input projections and return typed results to owned output slots. A required branch must join before its protected release boundary. Optional asynchronous findings cannot change a result already delivered.

02

Action graph example

The risk and context branches may run together on input. The format check runs on output after inference. Dependencies, phase boundaries, slots, deadlines and joins are explicit. external_side_effects stays false for the initial slice.

json
{
  "version": "2026-10-19-preview",
  "name": "Private review checks",
  "max_parallel": 2,
  "nodes": [
    {
      "id": "risk",
      "phase": "input",
      "placement": "customer_server",
      "trigger": {
        "field": "context.data_class",
        "equals": "internal"
      },
      "tool": "risk_check@1",
      "input_projection": [
        "context.data_class",
        "request.redacted_text"
      ],
      "depends_on": [],
      "required": true,
      "timeout_ms": 1500,
      "output_slot": "checks.risk",
      "on_failure": "block"
    },
    {
      "id": "context",
      "phase": "input",
      "placement": "customer_server",
      "trigger": {
        "field": "context.task",
        "equals": "code_review"
      },
      "tool": "approved_context_lookup@1",
      "input_projection": [
        "context.project_id"
      ],
      "depends_on": [],
      "required": false,
      "timeout_ms": 1000,
      "output_slot": "enrichment.context",
      "on_failure": "continue_without_result"
    },
    {
      "id": "format",
      "phase": "output",
      "placement": "customer_server",
      "trigger": {
        "field": "result.format",
        "equals": "json"
      },
      "tool": "schema_validate@1",
      "input_projection": [
        "result.body"
      ],
      "depends_on": [
        "risk"
      ],
      "required": true,
      "timeout_ms": 500,
      "output_slot": "checks.format",
      "on_failure": "block"
    }
  ],
  "join": "all_required_before_release",
  "external_side_effects": false
}
03

Trigger and node contract

Triggers compare approved context fields against typed values. Prompt instructions do not authorize tool access. A graph compiler verifies unique node IDs, known dependencies, acyclicity, supported phase/location, output-slot ownership and failure handling.

FieldContract
phase / placementInput or output; certified managed/server/device execution
triggerAllowlisted context field and expected value
tool / input_projectionPinned typed capability and least-privilege data selection
depends_on / output_slotExplicit ordering and deterministic merge ownership
required / on_failureRequired checks cannot continue without a result
timeout_ms / max_parallelBounded per-branch time and total fan-out
04

Cancellation, retries and effects

Cancel descendants when the parent request stops. Persist job state and use idempotency/fencing for retries and any future approved effect. Do not merge by arrival order or replay a committed action blindly. External messages, purchases, arbitrary URLs, shell commands and business mutations are outside the initial action slice.

05

Example flow

Input: classify context, redact secrets, run an allowed lookup and risk check, select an eligible route. Output: inspect the response, validate its grammar, run an allowed quality check, transform permitted fields and deliver. Every step stays inside policy and its declared data boundary.

Contracts & examples

Download the preview, validate its shape locally and review the capability limits before planning an integration.

OpenAPI preview

OptinRouter AI guide

Product and developer guidance.

A good place to start

What would you
like to know?

Ask about public APIs, policies, grammars, context actions or the product. This guide uses approved information and can’t reveal private details or take actions.

Recent messages stay in this page’s memory. Reload or reset to clear them here.