HTTP API Reference
This page documents all HTTP endpoints in the Open Reward Standard protocol.Base URL
All endpoints are relative to the ORS server base URL:Common Headers
X-Session-ID
Most endpoints require theX-Session-ID header to identify the episode:
/create, /delete, /ping, /{env_name}/call, /{env_name}/prompt
Not required for: /create_session, discovery endpoints, /health
Discovery Endpoints
These endpoints provide information about available environments, tools, and tasks. They do not require authentication or session IDs.GET /health
Health check endpoint. Request:GET /list_environments
List all available environments on this server. Request:/{env_name}/* endpoints.
Use case: Discover what environments are available before creating a session.
GET //tools
List all tools available in the specified environment. Request:tools: Array of ToolSpec objectsname: Tool identifier (string)description: Human-readable description (string)input_schema: JSON Schema defining tool parameters (object, optional)
- 404 Not Found: Environment name not recognized
GET //splits
List all task splits available in the environment. Request:- Array of Split objects
name: Split identifier (string)type: Split category - “train”, “validation”, or “test” (string)
- 404 Not Found: Environment name not recognized
POST //tasks
List tasks for a specific split. Request:split: Split name to query (string, required)
tasks: Array of task objects (structure is environment-specific)env_name: Environment name (string)
- 400 Bad Request: Invalid split name
- 404 Not Found: Environment name not recognized
Session Management
These endpoints manage episode lifecycle.POST /create_session
Generate a new session ID. Request:sid: Session identifier (string, UUID format)
/create.
POST /create
Create an episode instance for a specific task. Request:X-Session-ID: Session identifier from/create_session(required)
env_name: Environment to instantiate (string, required)task_spec: Task-specific data (object, required)secrets: Secrets to pass to environment (object, optional, default: )
- 400 Bad Request: Session already exists, or missing X-Session-ID header
- 404 Not Found: Environment name not recognized
setup() method.
Important: The environment initialization happens asynchronously. Subsequent requests wait for setup to complete.
POST /ping
Keep the session alive to prevent timeout. Request:X-Session-ID: Session identifier (required)
- 400 Bad Request: Missing X-Session-ID header
- 404 Not Found: Session not found
/ping periodically (e.g., every 5 minutes) to keep the session alive.
POST /delete
Delete an episode and clean up resources. Request:X-Session-ID: Session identifier (required)
- 400 Bad Request: Missing X-Session-ID header
- 404 Not Found: Session not found
teardown() method.
Important: Always call /delete when done with an episode to free server resources.
POST /delete_session
Optional cleanup endpoint for session ID. Request:X-Session-ID: Session identifier (required)
/delete. In practice, /delete is sufficient.
Episode Interaction
These endpoints interact with an active episode.GET //prompt
Get the initial prompt for the current task. Request:X-Session-ID: Session identifier (required)
- Array of Block objects
- TextBlock:
{"text": "...", "detail": null, "type": "text"} - ImageBlock:
{"data": "base64...", "mimeType": "image/png", "detail": null, "type": "image"}
- TextBlock:
- 400 Bad Request: Missing X-Session-ID header
- 404 Not Found: Session not found or environment name mismatch
- 410 Gone: Session was deleted
/create and before calling tools.
Note: Prompts can be multi-modal (text + images).
POST //call
Call a tool in the environment. Request:X-Session-ID: Session identifier (required)Accept: Must betext/event-stream(required for SSE)
name: Tool name to call (string, required)input: Tool-specific parameters (object, required)task_id: Optional ID for tracing (string, optional)
- 400 Bad Request: Missing X-Session-ID, invalid tool name, or invalid input
- 404 Not Found: Session not found, environment mismatch, or tool not found
- 410 Gone: Session was deleted
- Responses are streamed via Server-Sent Events (see Tool Execution with SSE section above)
- The
finishedfield indicates if the episode is complete - The
rewardfield provides RL feedback signal
Complete Episode Flow
Here’s a complete example showing all endpoints in sequence:Error Handling
Standard HTTP Status Codes
- 200 OK: Request succeeded
- 400 Bad Request: Invalid input (missing header, invalid JSON, etc.)
- 404 Not Found: Resource not found (environment, session, tool)
- 410 Gone: Session was deleted
- 500 Internal Server Error: Server error during processing
Error Response Format
For HTTP errors (non-SSE):Rate Limiting and Timeouts
Session Timeout
Sessions automatically expire after 15 minutes of inactivity:- “Activity” means any request with that session’s X-Session-ID
- Use
/pingto keep sessions alive - Timeout is reset after each request
Request Timeout
Individual requests may have server-specific timeouts. Long-running tool calls should use SSE streaming to avoid timeouts.Next Steps
Data Types
Detailed schemas for all request/response objects
Implementing a Client
Build an ORS client using these endpoints
Implementing a Server
Build an ORS server that implements these endpoints
Reference Implementation: The OpenReward Python SDK implements this complete API. See the server.py source for implementation details.

