Skip to main content
An agent is a synchronous TypeScript function that returns instructions. The OpenComputer runtime owns the durable conversation, streaming model calls, tool loop, and continuation. Your function calculates the agent configuration for the current render.
This keeps ordinary TypeScript control flow available. Hooks may be called conditionally, so a capability can be attached only when the current request needs it.

Hooks

useInput() is not a human-in-the-loop prompt. It describes the input that caused the current render. See Inputs for its text, payload, and source metadata.

Conditional configuration

The hook calls describe capabilities for the next model step; they do not run the model or tool themselves.

Define a tool

Tools are TypeScript values with JSON Schema inputs and an asynchronous or synchronous run function. Put the implementation beside the agent, for example at opencomputer/agents/hello-world/tools/hacker-news.ts:
Import and attach it from agent.ts:
Tool names may contain letters, numbers, underscores, and hyphens. Tool code runs in the managed agent runtime, not in the browser.

Skills

Skills are reusable instruction bundles. Add a skill only when an agent needs one:
Skills in an agent’s skills/ directory are packaged with that agent and can be loaded by the runtime when their description matches the task. Unlike tools, skills provide instructions and supporting resources rather than a callable JSON Schema function.

Models

Use provider/model strings:
An object form is also supported:
Provider credentials are managed by OpenComputer and are not placed in agent source or the React application. Continue with Agent hooks, then use the focused guides for inputs, models, tools, MCP servers, skills, subagents, and session data.