Canonical Request — ML Junction docs

The canonical request describes intent rather than provider-specific syntax. The gateway translates supported fields for each route and can reject or avoid routes that cannot satisfy strict requirements.

{
  "model": "gpt-5.5",
  "messages": [
    {
      "role": "system",
      "content": "You are a careful technical assistant."
    },
    {
      "role": "user",
      "content": "Compare optimistic and pessimistic locking."
    }
  ],
  "stream": false,
  "sampling": {
    "temperature": 0.3,
    "top_p": 0.9,
    "seed": 42
  },
  "reasoning": {
    "enabled": true,
    "effort": "medium",
    "summary": "concise"
  },
  "output": {
    "max_tokens": 3000,
    "format": {
      "type": "text"
    },
    "streaming_mode": "text",
    "validation": {
      "enabled": true,
      "heal_syntax": false,
      "model_repair": false,
      "max_repair_attempts": 1
    }
  },
  "requirements": {
    "tools": "off",
    "json_schema": "off",
    "vision": "off",
    "audio": "off",
    "pdf": "off",
    "reasoning": "preferred",
    "streaming": false,
    "min_context_tokens": 32000
  },
  "routing": {
    "strategy": "balanced",
    "mode": "platform_only",
    "strict_params": false,
    "only_providers": [],
    "ignored_providers": [],
    "require_zdr": false,
    "allow_provider_training": false,
    "fallbacks": {
      "provider": true,
      "model": true,
      "max_total_attempts": 5,
      "max_retries_per_route": 1,
      "same_or_lower_price": false,
      "preserve_context_window": true,
      "preserve_privacy": true
    },
    "sticky": {
      "enabled": true,
      "scope": "conversation",
      "ttl_seconds": 3600
    }
  },
  "context": {
    "mode": "auto_fit",
    "input_budget_ratio": 0.7,
    "min_output_reserve_tokens": 4096,
    "preserve_system": true,
    "preserve_current_user": true,
    "preserve_tool_chains": true
  },
  "metadata": {
    "feature": "locking-comparison"
  },
  "idempotency_key": "locking-comparison-2026-06-14"
}

Top-level fields

Field · Required · Meaning
model · Yes · Public model ID from GET /v1/models
messages · Yes · At least one message and at least one user-role message
stream · No · Return Server-Sent Events when true
sampling · No · Temperature, top-p, and deterministic seed preferences
reasoning · No · Reasoning enablement, effort/intensity, and summary preference
output · No · Token limit, output format, streaming behavior, and validation
tools · No · Up to 128 function tool definitions
tool_choice · No · Automatic, required, named, or provider-compatible tool selection
requirements · No · Capabilities that eligible routes must or should support
routing · No · Strategy, provider controls, privacy, billing mode, fallback, and affinity
context · No · Automatic context-fitting and preservation policy
metadata · No · Application metadata stored with the request
idempotency_key · No · Deduplicates a completed non-streaming request for one hour

Canonical URL: https://mljunction.com/docs/canonical-request