Oda SDK overview

The Oda SDK lets your own program drive DataMind Oda from outside the app: a client process starts an Oda runtime and talks to it over standard input and output, so the work runs out of process. Use it when a script or an internal tool, rather than a person in the app, should start the work and follow it.

The three parts

The SDK family comes in three parts, and each has its own guide:

PartWhat it is
Wire protocolThe newline-delimited JSON-RPC transport and the named request, result and notification types.
TypeScript clientA TypeScript package that starts the runtime for you and drives runs through a high-level and a protocol-level API.
Runtime serverThe serving side: it answers an out-of-process client over standard input and output, one client at a time and one agent per session id.

Where you go next depends on your side of the connection:

How a client starts a runtime

When your program uses the client, the client does the wiring:

  1. It starts the runtime as a subprocess: the SDK profile, the runtime binary that comes with the CLI package, and any extra --patch <path> files you pass, applied in order.
  2. It sends one start-up handshake (initialize) carrying the working folder and the model route: provider, model, and, optionally, a reasoning effort and a token cap.
  3. The runtime resolves that exact route before it accepts any prompt. A provider, model or effort it cannot serve fails the handshake instead of falling back to a default.

Prompts are refused until the handshake completes.

The wire at a glance

The connection is newline-delimited: one JSON-RPC 2.0 message per line, over streams the caller owns. Three requests and four notifications:

MessageKindWhat it does
initializeRequestSets up the connection and resolves the model route.
session/promptRequestQueues one user message and returns its receipt (messageId) immediately.
shutdownRequestFlushes what the runtime has written, winds its work down and exits.
session.eventNotificationA session event, as it is appended.
session.statusNotificationThe whole agent's status: running or idle.
subagent.startedNotificationA subagent session started, with its parent lineage.
subagent.finishedNotificationA subagent run finished; sent only for runs in the same process.

The run lifecycle

Limits to know before you build

The full list is on the SDK wire protocol page.

Questions, answered

Which part of the SDK do I need?

It depends on your side of the connection. To drive Oda from a TypeScript program, use the TypeScript client guide. To write a client in another language or read the messages, use the SDK wire protocol. To serve clients from a runtime of your own, read Run an Oda runtime server.

Can I drive Oda from another language?

Yes. The connection is newline-delimited JSON-RPC over standard input and output, and nothing about it is specific to TypeScript: implement the messages and you have a client. The SDK wire protocol documents every message for that work, and the TypeScript client is one implementation of it.

Who starts the runtime?

The client does. It starts the runtime as a subprocess the first time it is needed, with the SDK profile and your launch settings, and keeps it for later runs; you never launch the runtime by hand.

Does the SDK need the Oda app window open?

No. The runtime is a process of its own and the client talks to it over standard input and output; the app window is not involved.

What can I automate with the SDK?

A runtime is a complete Oda runtime, so an SDK session works like any other Oda session, with the same planning, tools and subagents. The connection changes how the work is started and followed, not what Oda can do.

Where do I look when a call fails?

Start where it failed. Failures on your side of the connection, like a timeout or a client that closed, are on the TypeScript client guide. Message-level failures, like an unknown method or a route that could not be resolved, are on the SDK wire protocol. Refusals the runtime itself reports are on Run an Oda runtime server.