> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream build logs

> Follow a template build live over Server-Sent Events.

Streams the build log as [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). Use it to render a live, Docker-style build console. The stream stays open for the duration of the build and closes when it reaches `ready` or `failed`.

Each `data:` frame is a JSON object:

<ResponseField name="ts" type="string">Event timestamp (ISO 8601).</ResponseField>
<ResponseField name="level" type="string">`info`, `success`, `warn`, or `error`.</ResponseField>

<ResponseField name="phase" type="string">
  Build phase: `publish`, `compile`, `boot`, `install`, `snapshot`, `record`, `archive`, or `ready`. A cancelled or timed-out build ends on `cancel` or `timeout`.
</ResponseField>

<ResponseField name="source" type="string">Origin of the line, e.g. `apt`, `pip`, `npm`, or `builder`. Optional.</ResponseField>
<ResponseField name="line" type="string">A single line of build output.</ResponseField>

## Path parameters

<ParamField path="namespace" type="string" required>Template namespace.</ParamField>
<ParamField path="name" type="string" required>Template name.</ParamField>
<ParamField path="version" type="string" required>Version (semver).</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -N https://www.orgo.ai/api/templates/default/claude-code/1.0.0/build/events \
    -H "Authorization: Bearer $ORGO_API_KEY"
  ```

  ```python Python theme={null}
  import os, json, requests

  with requests.get(
      "https://www.orgo.ai/api/templates/default/claude-code/1.0.0/build/events",
      headers={"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"},
      stream=True,
  ) as r:
      for raw in r.iter_lines():
          if raw and raw.startswith(b"data: "):
              event = json.loads(raw[6:])
              print(f"[{event['phase']}] {event['line']}")
  ```

  ```javascript JavaScript theme={null}
  // Browser: EventSource doesn't send Authorization headers, so stream with fetch.
  const r = await fetch(
    "https://www.orgo.ai/api/templates/default/claude-code/1.0.0/build/events",
    { headers: { Authorization: `Bearer ${process.env.ORGO_API_KEY}` } },
  );
  const reader = r.body.getReader();
  const decoder = new TextDecoder();
  for (;;) {
    const { value, done } = await reader.read();
    if (done) break;
    for (const line of decoder.decode(value).split("\n")) {
      if (line.startsWith("data: ")) {
        const e = JSON.parse(line.slice(6));
        console.log(`[${e.phase}] ${e.line}`);
      }
    }
  }
  ```
</CodeGroup>

### Stream

```text theme={null}
data: {"ts":"2026-06-08T17:00:01Z","level":"info","phase":"boot","line":"booting build VM"}

data: {"ts":"2026-06-08T17:00:14Z","level":"info","phase":"install","source":"npm","line":"npm install -g @anthropic-ai/claude-code"}

data: {"ts":"2026-06-08T17:01:50Z","level":"info","phase":"archive","source":"builder","line":"uploading golden snapshot"}

data: {"ts":"2026-06-08T17:01:58Z","level":"success","phase":"ready","line":"golden snapshot ready in 118.4s"}
```


## OpenAPI

````yaml GET /templates/{namespace}/{name}/{version}/build/events
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: spencer@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Streaming
    description: Stream computer display via RTMP
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
paths:
  /templates/{namespace}/{name}/{version}/build/events:
    get:
      tags:
        - Templates
      summary: Stream build logs
      description: >-
        Server-Sent Events stream of live golden-build progress. Each `data:`
        frame is a BuildEvent JSON object. The stream ends after a terminal
        `ready` (or error) event.
      operationId: streamBuildEvents
      parameters:
        - name: namespace
          in: path
          required: true
          schema:
            type: string
        - name: name
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: SSE stream of BuildEvent frames
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/BuildEvent'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    BuildEvent:
      type: object
      description: One frame of the build-events SSE stream.
      properties:
        ts:
          type: string
          format: date-time
        level:
          type: string
          enum:
            - info
            - success
            - warn
            - error
        phase:
          type: string
          enum:
            - publish
            - compile
            - boot
            - install
            - snapshot
            - record
            - archive
            - ready
            - cancel
            - timeout
        source:
          type: string
          description: Origin of the line, e.g. apt, pip, npm, builder.
        line:
          type: string
          description: A single line of build output.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````