Captions, summaries, prompts, copy
API document
Host routes and invocation API
CodexDock exposes a conventional route surface for creating owner-scoped work, connecting local workers, claiming jobs, and reading completed results.
Routes
Default host endpoints
These paths are defaults, not the security boundary. A host can mount them elsewhere as long as discovery points the CLI to the right URLs.
| Method | Route | Purpose |
|---|---|---|
GET | /api/codexdock/discovery | Returns the host endpoint manifest used by the CLI. |
POST | /api/codexdock/pairing/code | Creates a short-lived browser-scoped pairing code. |
POST | /api/codexdock/pairing/exchange | Exchanges a pairing code for an owner-scoped worker token. |
POST | /api/codexdock/invoke | Creates a pending owner-scoped invocation. |
GET | /api/codexdock/invocations/[invocationId] | Reads invocation status and completed results for the owner. |
POST | /api/codexdock/worker/connect | Registers or refreshes a local worker connection. |
GET | /api/codexdock/worker/status | Reports worker and queue status for operations. |
POST | /api/codexdock/worker/next | Claims the next matching pending invocation. |
POST | /api/codexdock/worker/result | Submits a validated worker result. |
Create work
One invocation lifecycle, four generation types.
The type controls the worker capability and result envelope. The host can attach business context through parameters.
Server-side invocation
const invocation = await codexdock.invoke({
type: "generate_object",
prompt: "Create four product cards.",
parameters: { count: 4, usage: "product-preview" },
});
// {
// invocationId: "inv_123",
// status: "pending",
// statusUrl: "/api/codexdock/invocations/inv_123"
// }Structured UI data or domain objects
Markdown, source files, generated artifacts
Thumbnails, avatars, visual assets