Data Types
This page documents all data structures used in the Open Reward Standard protocol. Type definitions are shown in TypeScript notation but apply to any language implementation.Core Types
JSONValue
Recursive type representing any valid JSON value:Block Types
Blocks are the fundamental unit of content in ORS. They can be text or images.TextBlock
Text content with optional metadata:type: Always"text"(literal)text: The text content (string)detail: Optional metadata about this text block (object)
ImageBlock
Image content encoded as base64:type: Always"image"(literal)data: Base64-encoded image data (string)mimeType: MIME type like"image/png","image/jpeg"(string)detail: Optional metadata about this image (object)
Blocks
Array of blocks (text and/or images):Tool Types
ToolSpec
Specification for an available tool:name: Tool identifier, used when calling the tool (string)description: Human-readable description of what the tool does (string)input_schema: JSON Schema defining tool parameters (object, optional)
input_schema is null or omitted, the tool takes no parameters.
ToolOutput
Result of executing a tool:blocks: Output content (array of TextBlock/ImageBlock, required)reward: RL reward signal (number, optional)finished: Whether episode is complete (boolean, required, default: false)metadata: Optional additional data (object)
finished:
- Critical for episode termination
- When
true, the episode is complete - Agent should stop calling tools and delete the session
- Represents task completion (success or failure)
reward:
- RL feedback signal
- Typically 0.0 for intermediate steps, 1.0 for success, 0.0 or negative for failure
- Optional - can be null if not using RL
- Sparse rewards: only at episode end
- Dense rewards: after each action
ToolCall
Request to execute a tool:name: Tool to call (string, required)input: Tool parameters matching its input_schema (object, required)task_id: Optional ID for tracing/logging (string)
ListToolsOutput
Response fromGET /{env_name}/tools:
Tool Result Types
Tool execution returns one of two result types:RunToolSuccess
Successful tool execution:RunToolError
Failed tool execution:RunToolOutput
Union type for tool results:ok field discriminates between success and error:
ok: true→ result hasoutputfieldok: false→ result haserrorfield
end event from POST /{env_name}/call.
Task Types
Task
Tasks are environment-specific JSON objects:Split
Categorization of task lists:name: Split identifier (string)type: Split category (string, one of: “train”, “validation”, “test”)
{"name": "train", "type": "train"}- Training tasks{"name": "validation", "type": "validation"}- Validation tasks{"name": "test", "type": "test"}- Test tasks
ListTasks
Request body forPOST /{env_name}/tasks:
Session Types
CreateSession
Request to create an episode:env_name: Environment to instantiate (string, required)task_spec: Task data for this episode (object, required)secrets: API keys, credentials, etc. (object, required but can be empty)
Type Examples by Use Case
Discovery Flow
Episode Flow
Type Validation
Implementations should validate:Input Validation
- Tool calls match the tool’s
input_schema - Required fields are present
- Types match specifications
Output Guarantees
ToolOutput.blocksis non-empty arrayToolOutput.finishedis booleanToolOutput.rewardis number or null- Block
typeis exactly “text” or “image”
Episode Invariants
- Once
finished: trueis returned, no more tools should be called - Session IDs are unique across the server
- Tool names match those in
list_tools()output
Language-Specific Notes
Python (Reference Implementation)
TypeScript
JSON Schema
For validation in any language, use JSON Schema:Next Steps
HTTP API
See how these types are used in API endpoints
Sessions
Understand episode lifecycle and state
Tools Concept
Learn about tool design and usage
Implementation Guide
Implement these types in your server
Key Takeaway: ORS uses simple, composable types. Blocks provide flexible content representation. ToolOutput bundles content, rewards, and episode termination. Task structure is environment-specific for maximum flexibility.

