~/docs/endpoints

Endpoints

Registering HTTP routes on your services with method, path, and schema.


Endpoints are registered HTTP routes on a service. Each endpoint has a method, a path, an optional description, and an optional input schema. The OpenCode agent registers them automatically when building a service.

Supported Methods

GET — Retrieve data

POST — Create data or trigger actions

PUT — Update existing data

DELETE — Remove data

PATCH — Partially update data

Proxy Architecture

All services run behind a Next.js proxy that mounts them at/api/s/{serviceId}. When a request comes in, the proxy forwards it to the correct Deno process using fetch().

This means WebSocket upgrades (Deno.upgradeWebSocket()) do not work in production. OpenCode is trained to use HTTP short polling as a replacement.

Path Matching

Because of the proxy, route matching uses endsWithinstead of exact path matching. OpenCode handles this automatically when writing service code.


Create execution plans with workflows.Workflows