Skip to content

HTTP models: RetryPolicy – SessionMessageActionResult

Exact OpenAPI component declarations. $ref values identify other components in the complete schema.

{
"properties": {
"max_attempts": {
"type": "integer",
"maximum": 50.0,
"minimum": 1.0,
"title": "Max Attempts",
"default": 5
},
"max_unknown_attempts": {
"type": "integer",
"maximum": 50.0,
"minimum": 1.0,
"title": "Max Unknown Attempts",
"default": 2
},
"initial_delay_s": {
"type": "number",
"maximum": 600.0,
"minimum": 0.0,
"title": "Initial Delay S",
"default": 0.5
},
"max_delay_s": {
"type": "number",
"maximum": 3600.0,
"minimum": 0.0,
"title": "Max Delay S",
"default": 30.0
},
"backoff_multiplier": {
"type": "number",
"maximum": 10.0,
"minimum": 1.0,
"title": "Backoff Multiplier",
"default": 2.0
},
"jitter_s": {
"type": "number",
"maximum": 600.0,
"minimum": 0.0,
"title": "Jitter S",
"default": 0.5
},
"retry_on_status_codes": {
"items": {
"type": "integer"
},
"type": "array",
"maxItems": 32,
"minItems": 0,
"title": "Retry On Status Codes",
"default": [
429,
500,
502,
503,
504,
529
]
},
"retry_on_timeout": {
"type": "boolean",
"title": "Retry On Timeout",
"default": true
},
"retry_on_connection_error": {
"type": "boolean",
"title": "Retry On Connection Error",
"default": true
},
"retry_on_rate_limit": {
"type": "boolean",
"title": "Retry On Rate Limit",
"default": true
}
},
"additionalProperties": false,
"type": "object",
"title": "RetryPolicy",
"description": "Retry controls for one provider model step.\n\n`max_attempts` includes the initial attempt. The default permits five total\nattempts for classified transient provider failures. Unknown provider\nfailures retain the stricter `max_unknown_attempts` ceiling.\n\nFrozen: policies are immutable value objects, so they can be shared across\nattempts and sessions without per-attempt defensive copies."
}
{
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"title": "Prompt"
},
"session_id": {
"anyOf": [
{
"type": "string",
"maxLength": 128,
"minLength": 1,
"pattern": "^[A-Za-z0-9][A-Za-z0-9._~-]*$"
},
{
"type": "null"
}
],
"title": "Session Id",
"description": "Optional caller-selected identity for replay-safe run observation. Before the first event, reconnect with `session_id:` using this session ID."
},
"agent": {
"type": "string",
"minLength": 1,
"title": "Agent",
"default": "assistant"
},
"target": {
"anyOf": [
{
"$ref": "#/components/schemas/ModelTarget"
},
{
"type": "null"
}
]
},
"failover": {
"anyOf": [
{
"$ref": "#/components/schemas/ModelFailoverPolicy"
},
{
"type": "null"
}
]
},
"causal_budget_id": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
],
"title": "Causal Budget Id"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Labels"
},
"max_steps": {
"type": "integer",
"maximum": 9007199254740991.0,
"minimum": 1.0,
"title": "Max Steps",
"default": 64
},
"limits": {
"$ref": "#/components/schemas/RunLimits"
},
"budget_limits": {
"items": {
"$ref": "#/components/schemas/BudgetLimit"
},
"type": "array",
"title": "Budget Limits"
},
"retry_policy": {
"anyOf": [
{
"$ref": "#/components/schemas/RetryPolicy"
},
{
"type": "null"
}
]
},
"tool_completion": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolCompletionPolicy"
},
{
"type": "null"
}
]
},
"structured_output": {
"anyOf": [
{
"$ref": "#/components/schemas/StructuredOutputSpec"
},
{
"type": "null"
}
]
},
"thinking": {
"anyOf": [
{
"$ref": "#/components/schemas/ThinkingConfig"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"prompt"
],
"title": "RunBody"
}
{
"properties": {
"max_input_tokens": {
"anyOf": [
{
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Max Input Tokens"
},
"max_output_tokens": {
"anyOf": [
{
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Max Output Tokens"
},
"max_total_tokens": {
"anyOf": [
{
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Max Total Tokens"
},
"max_tool_calls": {
"anyOf": [
{
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Max Tool Calls"
},
"max_elapsed_seconds": {
"anyOf": [
{
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Max Elapsed Seconds"
},
"scope": {
"type": "string",
"enum": [
"session",
"run"
],
"title": "Scope",
"default": "run"
}
},
"additionalProperties": false,
"type": "object",
"title": "RunLimits",
"description": "Optional hard limits for one session run or resume call.\n\nEvery limit is evaluated against the clock selected by ``scope``:\n\n- ``scope=\"run\"`` (the default): token, tool-call, and elapsed-time\n limits all measure the current runtime invocation \u2014 usage deltas since\n the original run entered and active time since the run started. Durable\n approval and user-input continuations retain the baseline and exclude the\n human wait interval. A fresh run or clean-boundary resume resets it.\n- ``scope=\"session\"``: token, tool-call, and elapsed-time limits all\n measure the whole durable session \u2014 cumulative usage from the session\n event stream and wall time since the session was created. A resumed\n session that already meets a limit stops immediately."
}
{
"type": "string",
"enum": [
"wheel",
"oci_image",
"source_tree",
"other"
],
"title": "RuntimeBuildArtifactKind",
"description": "Digest domain whose bytes or manifest identify the build."
}
{
"properties": {
"schema_version": {
"type": "integer",
"const": 1,
"title": "Schema Version",
"default": 1
},
"recipe": {
"type": "string",
"const": "cayu.runtime-build-provenance.v1",
"title": "Recipe",
"default": "cayu.runtime-build-provenance.v1"
},
"origin": {
"$ref": "#/components/schemas/RuntimeBuildProvenanceOrigin"
},
"availability": {
"$ref": "#/components/schemas/RuntimeBuildProvenanceAvailability"
},
"strength": {
"$ref": "#/components/schemas/RuntimeBuildProvenanceStrength"
},
"fingerprint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Fingerprint"
},
"artifact_kind": {
"anyOf": [
{
"$ref": "#/components/schemas/RuntimeBuildArtifactKind"
},
{
"type": "null"
}
]
},
"artifact_digest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Artifact Digest"
},
"source_revision": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Revision"
},
"detail_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Detail Code"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"origin",
"availability",
"strength"
],
"title": "RuntimeBuildProvenance",
"description": "Versioned, bounded identity for the exact Cayu runtime build."
}
{
"type": "string",
"enum": [
"available",
"unavailable"
],
"title": "RuntimeBuildProvenanceAvailability",
"description": "Whether exact build identity is available for admission."
}
{
"type": "string",
"enum": [
"wheel_record",
"oci_image_digest",
"development_source_tree",
"explicit_manifest",
"legacy_record",
"unavailable"
],
"title": "RuntimeBuildProvenanceOrigin",
"description": "Boundary that supplied one runtime build identity."
}
{
"type": "string",
"enum": [
"structural",
"application_versioned",
"unavailable"
],
"title": "RuntimeBuildProvenanceStrength",
"description": "Execution-profile strength vocabulary for runtime build identity."
}
{
"properties": {
"subject": {
"type": "string",
"maxLength": 512,
"title": "Subject"
},
"tenant": {
"anyOf": [
{
"type": "string",
"maxLength": 512
},
{
"type": "null"
}
],
"title": "Tenant"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"subject"
],
"title": "ServerContractActor",
"description": "Bounded actor projection that deliberately excludes arbitrary claims."
}
{
"properties": {
"api_prefix": {
"type": "string",
"title": "Api Prefix",
"default": "/api"
},
"contract_version": {
"type": "string",
"title": "Contract Version",
"default": "48"
},
"versioning": {
"$ref": "#/components/schemas/VersioningContract"
},
"accounting": {
"$ref": "#/components/schemas/AccountingContract"
},
"sse": {
"$ref": "#/components/schemas/SseContract"
},
"client_generation": {
"$ref": "#/components/schemas/ClientGenerationContract"
},
"client": {
"$ref": "#/components/schemas/BrowserClientContract"
},
"capabilities": {
"$ref": "#/components/schemas/ControlPlaneCapabilities"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"accounting",
"capabilities"
],
"title": "ServerContractResponse"
}
{
"properties": {
"agent_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Agent Name"
},
"provider_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider Name"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Model"
},
"environment_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Environment Name"
},
"parent_session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parent Session Id"
},
"causal_budget_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Causal Budget Id"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"maxProperties": 50,
"title": "Labels"
},
"label_selectors": {
"items": {
"$ref": "#/components/schemas/LabelSelectorRequirement"
},
"type": "array",
"maxItems": 25,
"title": "Label Selectors"
}
},
"additionalProperties": false,
"type": "object",
"title": "SessionAggregateFilter",
"description": "Current session attributes that may scope a store-native aggregate."
}
{
"properties": {
"pricing": {
"$ref": "#/components/schemas/PriceBook"
},
"currency": {
"type": "string",
"minLength": 1,
"title": "Currency",
"default": "USD"
}
},
"type": "object",
"required": [
"pricing"
],
"title": "SessionCostBody"
}
{
"properties": {
"supported": {
"type": "boolean",
"title": "Supported"
},
"method": {
"type": "string",
"const": "POST",
"title": "Method",
"default": "POST"
},
"path": {
"type": "string",
"title": "Path"
},
"request_schema": {
"type": "string",
"const": "SessionCostBody",
"title": "Request Schema",
"default": "SessionCostBody"
},
"response_schema": {
"type": "string",
"const": "SessionCostSummary",
"title": "Response Schema",
"default": "SessionCostSummary"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"supported",
"path"
],
"title": "SessionCostEndpointContract",
"description": "Estimated session cost from a caller-supplied price book."
}
{
"properties": {
"session_id": {
"type": "string",
"title": "Session Id"
},
"currency": {
"type": "string",
"title": "Currency"
},
"model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Model Steps"
},
"priced_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Priced Model Steps"
},
"unpriced_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Unpriced Model Steps"
},
"auxiliary_attempts": {
"type": "integer",
"minimum": 0.0,
"title": "Auxiliary Attempts",
"default": 0
},
"unpriced_auxiliary_attempts": {
"type": "integer",
"minimum": 0.0,
"title": "Unpriced Auxiliary Attempts",
"default": 0
},
"missing_usage_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Missing Usage Model Steps",
"default": 0
},
"missing_pricing_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Missing Pricing Model Steps",
"default": 0
},
"unsupported_pricing_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Unsupported Pricing Model Steps",
"default": 0
},
"total_cost": {
"type": "string",
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
"title": "Total Cost"
},
"line_items": {
"items": {
"$ref": "#/components/schemas/CostLineItem"
},
"type": "array",
"title": "Line Items"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"session_id",
"currency",
"model_steps",
"priced_model_steps",
"unpriced_model_steps",
"total_cost"
],
"title": "SessionCostSummary",
"description": "Detailed cost inspection, retaining one line item per completed step."
}
{
"type": "string",
"enum": [
"needs_attention",
"session_failure",
"tool_issue",
"interruption"
],
"title": "SessionDebugState"
}
{
"type": "string",
"enum": [
"http_run",
"sdk_run",
"fork",
"subagent",
"task",
"workflow_step"
],
"title": "SessionExecutionSource",
"description": "The runtime boundary that created one session."
}
{
"properties": {
"schema_version": {
"type": "integer",
"const": 1,
"title": "Schema Version",
"default": 1
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"state": {
"type": "string",
"enum": [
"executing",
"idle",
"waiting",
"owner_lost",
"terminal",
"unknown"
],
"title": "State"
},
"owner_kind": {
"anyOf": [
{
"type": "string",
"enum": [
"in_process_runner",
"server_stream",
"task_worker",
"recovery",
"foreground_child_delivery"
]
},
{
"type": "null"
}
],
"title": "Owner Kind"
},
"owner_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Id"
},
"owner_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Owner Label"
},
"local_owner": {
"type": "boolean",
"title": "Local Owner",
"default": false
},
"run_epoch": {
"type": "integer",
"minimum": 0.0,
"title": "Run Epoch"
},
"operation_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Operation Id"
},
"claimed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Claimed At"
},
"heartbeat_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Heartbeat At"
},
"lease_expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Lease Expires At"
},
"last_progress_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Last Progress At"
},
"last_progress_kind": {
"anyOf": [
{
"type": "string",
"enum": [
"model_stream",
"tool_call",
"waiting_for_input",
"publishing"
]
},
{
"type": "null"
}
],
"title": "Last Progress Kind"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"session_id",
"state",
"run_epoch"
],
"title": "SessionExecutionState",
"description": "Content-free liveness evaluated by the store clock; reading never renews it."
}
{
"properties": {
"method": {
"type": "string",
"const": "GET",
"title": "Method",
"default": "GET"
},
"path_template": {
"type": "string",
"title": "Path Template",
"default": "/api/sessions/{session_id}/events/stream"
},
"event_id_format": {
"type": "string",
"const": "session_id:cayu_event_<sequence>",
"title": "Event Id Format",
"default": "session_id:cayu_event_<sequence>"
},
"start_query_param": {
"type": "string",
"const": "after_sequence",
"title": "Start Query Param",
"default": "after_sequence"
},
"resume_header": {
"type": "string",
"const": "Last-Event-ID",
"title": "Resume Header",
"default": "Last-Event-ID"
},
"unknown_event_marker_behavior": {
"type": "string",
"const": "reject",
"title": "Unknown Event Marker Behavior",
"default": "reject"
},
"filter_query_params": {
"items": {
"type": "string",
"enum": [
"event_type",
"exclude_event_type",
"interaction_id"
]
},
"type": "array",
"title": "Filter Query Params",
"default": [
"event_type",
"exclude_event_type",
"interaction_id"
]
},
"event_data_schema": {
"type": "string",
"const": "SseEventEnvelope",
"title": "Event Data Schema",
"default": "SseEventEnvelope"
},
"heartbeat_interval_seconds": {
"type": "number",
"exclusiveMinimum": 0.0,
"title": "Heartbeat Interval Seconds",
"description": "Seconds between SSE comment heartbeat lines that start with `:`.",
"default": 15.0
},
"end_event_name": {
"type": "string",
"const": "end",
"title": "End Event Name",
"default": "end"
},
"end_data_schema": {
"type": "string",
"const": "SseSessionFollowEndEnvelope",
"title": "End Data Schema",
"default": "SseSessionFollowEndEnvelope"
},
"terminal_behavior": {
"type": "string",
"const": "end_after_terminal_event",
"title": "Terminal Behavior",
"default": "end_after_terminal_event"
},
"idle_timeout_seconds": {
"type": "number",
"exclusiveMinimum": 0.0,
"title": "Idle Timeout Seconds",
"description": "Seconds a running session may produce no durable events before the stream sends a retryable `replay_idle_timeout` error and closes.",
"default": 300.0
},
"max_streams_per_principal": {
"type": "integer",
"minimum": 1.0,
"title": "Max Streams Per Principal",
"default": 16
},
"max_streams_per_session": {
"type": "integer",
"minimum": 1.0,
"title": "Max Streams Per Session",
"default": 32
},
"limit_exceeded_status": {
"type": "integer",
"const": 429,
"title": "Limit Exceeded Status",
"default": 429
},
"end_data_example": {
"$ref": "#/components/schemas/SseSessionFollowEndEnvelope"
}
},
"additionalProperties": false,
"type": "object",
"title": "SessionFollowContract",
"description": "Read-only SSE stream that follows one session's durable events.\n\nThe stream never admits, re-runs, or acknowledges a mutation. It emits the\nsame ``SseEventEnvelope`` frames as mutation streams, SSE comment heartbeats,\nand one final ``event: end`` frame after the session's terminal event."
}
{
"properties": {
"session_instance_id": {
"type": "string",
"maxLength": 512,
"minLength": 1,
"title": "Session Instance Id"
},
"idempotency_key": {
"type": "string",
"maxLength": 256,
"minLength": 1,
"title": "Idempotency Key"
},
"expected_revision": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"title": "Expected Revision"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"session_instance_id",
"idempotency_key",
"expected_revision"
],
"title": "SessionMessageActionBody"
}
{
"properties": {
"record": {
"$ref": "#/components/schemas/SessionMessageInspectionRecord"
},
"event": {
"$ref": "#/components/schemas/Event"
},
"replayed": {
"type": "boolean",
"title": "Replayed",
"default": false
}
},
"additionalProperties": false,
"type": "object",
"required": [
"record",
"event"
],
"title": "SessionMessageActionResult",
"description": "Terminal queue mutation and its atomically persisted content-free event."
}