# opencode · Embedding interfaces

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [opencode](https://ai-agents-review.com/runtime/opencode.md)
- Column: [Embedding interfaces](https://ai-agents-review.com/column/embedding-interfaces.md) (Product integration)
- Mark: 4 s
- Default deployment: 4
- Best supported configuration: 4
- Page: https://ai-agents-review.com/cell/opencode/embedding-interfaces

## Rationale

In-process SDK plus HTTP API with typed events, prompt/interrupt/fork/inbox, permission replies and an ACP agent, all in release

## Rubric criteria for this column

- 0: Interactive UI only
- 1: Non-interactive CLI with text or JSON output only (scraping)
- 2: One supported programmatic interface (library **or** protocol) with an event stream, marked experimental or covering only part of the session lifecycle
- 3: Supported programmatic interface with typed events **and** session lifecycle control (start, follow-up/steer, interrupt, resume)
- 4: Level 3, plus host callbacks for approvals or host-executed tools **and** two or more transports or bindings (e.g. in-process plus network protocol)

## Review finding

Built in: `@opencode/sdk` in-process host (promise and Effect APIs); HTTP API (OpenAPI) with volatile SSE events plus an experimental durable-log SSE; Basic/HMAC-token auth; ACP agent (`opencode acp`); generated client. Several features are dev-only (Note I-7). [I93][I94][I95][I96][I97][I98]

## Evidence cited by the mark

- [I93] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/sdk/src/opencode.ts#L10-L42 — `OpenCode.create()` in-process client (sessions, events, plugin, close) — [S]
- [I94] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/protocol/src/groups/session.ts#L145-L900 — session HTTP API (prompt, interrupt, fork, revert, wait, background, inbox…) — [S]
- [I98] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/cli/src/acp/agent.ts — ACP agent implementation (`opencode acp`) — [S] (skimmed)

## Evidence also cited by the review finding

- [I95] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/protocol/src/groups/event.ts#L69-L78 — `/api/event` SSE "volatile by contract" — [S]
- [I96] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/protocol/src/groups/session.ts#L729-L750 — `/api/experimental/session/:id/log` durable-log SSE — [S]
- [I97] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/server/src/auth.ts#L15-L50 — Basic auth + HMAC session tokens — [S]

## Grading record

- Grader A (default / best): 4 / 4
- Grader B (default / best): 4 / 4
