Skip to main content
Pioneer clients communicate with a gateway through JSON-RPC 2.0 over WebSocket. The desktop app, mobile app, shared client core, and custom clients use this contract without linking to gateway internals. The protocol reference documents the public surface from crates/protocol. If a method, event, or payload is not exported there, treat it as an implementation detail.

Transport

The default gateway listener is:
The gateway accepts WebSocket text frames containing JSON-RPC requests. Server responses and notifications are also WebSocket text frames. A small number of upload paths use binary frames; those are documented on the relevant feature page.

Authentication

The WebSocket handshake must include a bearer token:
The token is a gateway superuser JWT. You can issue one from the CLI:
Tokens are validated during the WebSocket handshake. A missing or invalid bearer token rejects the connection with HTTP 401. The superuser JWT signing material is stored in the gateway keystore. Rotate it with pioneer secrets rotate-jwt-token superuser; existing superuser bearer tokens become invalid and must be reissued.

Request envelope

Every request uses JSON-RPC 2.0. Request ids are strings with exactly 21 characters.
Successful responses return the same id:
Errors use JSON-RPC error envelopes:
Core JSON-RPC error codes are: Feature-specific errors may include error.data with a machine-readable code and details.

Notifications

Notifications are server-to-client JSON-RPC messages without an id. They are how clients observe long-running turns, tool output, task events, MCP status, and skill catalog changes.
Clients should treat request responses as acceptance or lookup results, not as the complete operation. For example, turn/start returns after the gateway accepts the turn; the assistant response arrives through turn/* and item/* notifications.

Naming conventions

Method names use slash-separated groups:
Payload field casing is mostly inherited from Rust serde attributes. Many request/response structs use snake_case fields, while task and timeline models often use camelCase. Do not infer casing from method names; use the schema or examples for the exact payload.

Schemas

JSON Schemas are generated from crates/protocol and written to /schemas. The schema file names use snake_case type names, for example:
  • /schemas/turn_start_params.json
  • /schemas/thread_tree_response.json
  • /schemas/mcp_install_params.json
  • /schemas/task_create_params.json
When implementing a client, use this reference for behavior and the generated schemas for exact type validation.

Reference sections

Workspace & Threads

Workspace listing, creation, selection, renaming, thread creation, folders, history, and subscription cleanup.

AGENTS.md

Thread-tree instruction file read, save, archive, resolve, and notification methods.

Turns

Turn submission, cancellation, item events, timeline composition, and streaming notifications.

Providers

Provider listing, model listing, and API key management.

CLI Runtime

Codex CLI runtime listing, model catalogs, thread bindings, approvals, login, review, compaction, fork, and turn steering.

Settings

Gateway-scoped general, memory, thread-context, CLI runtime, and remote-access settings read/update methods.

Skills

Skill upload, install, update, uninstall, policy, health, and catalog notifications.

Memory

Durable memory search, remember, forget, candidate review methods, and memory notifications.

MCP Servers

MCP install config, policy, restart, uninstall, details, runtime status, and catalog notifications.

Tasks

Durable task creation, scheduling, subagents, task trees, waiting, deliveries, and task events.

Artifacts

Workspace file upload, listing, preview reads, downloads, bindings, artifact notifications, and model-facing artifact read behavior.