> ## 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.

# Test-run a template

> Boot a short-lived preview computer from a template ref.

Boots a **short-lived, auto-reaped** computer from a template `ref` - the same in-editor "Run" that the dashboard uses to test a template before sharing it. The preview is reclaimed automatically after a period of inactivity.

<Note>
  Test-runs require a **Scale** plan. For a **persistent** computer, use [Create computer](/api-reference/computers/create) with `template_ref` instead - that's the durable path and it counts toward your plan's computer quota.
</Note>

## Request body

<ParamField body="ref" type="string" required>
  Template ref to boot, in `namespace/name@version` form. Your own (`default/…`) or a curated (`system/…`) ref. The template's build must be `ready`.
</ParamField>

## Response

Returns a short-lived computer you connect to exactly like any other. The key fields:

<ResponseField name="desktop_id" type="string">
  The preview's identifier. Build its connection URLs the same way as any computer (`https://www.orgo.ai/desktops/{desktop_id}/…`), and pass it back to stop the run.
</ResponseField>

<ResponseField name="id" type="string">
  The underlying VM id.
</ResponseField>

<ResponseField name="status" type="string">
  Current status.
</ResponseField>

<ResponseField name="vnc_password" type="string">
  VNC / WebSocket token for the preview.
</ResponseField>

See [Create computer](/api-reference/computers/create) for the full connection model.

## Example

<CodeGroup>
  ```bash Start theme={null}
  curl -X POST https://www.orgo.ai/api/templates/run \
    -H "Authorization: Bearer $ORGO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"ref": "default/my-template@1.0.0"}'
  ```

  ```bash Stop theme={null}
  # Stop the preview when you're done (id = desktop_id from the run response)
  curl -X DELETE "https://www.orgo.ai/api/templates/run?id=$DESKTOP_ID" \
    -H "Authorization: Bearer $ORGO_API_KEY"
  ```
</CodeGroup>

## Stop a test-run

`DELETE /templates/run?id={desktop_id}` stops the preview and reclaims the VM. Previews are also reaped automatically, so a missed stop won't leak a computer.

## Errors

| Status | Meaning                                                                               |
| ------ | ------------------------------------------------------------------------------------- |
| `401`  | Missing or invalid API key.                                                           |
| `403`  | Test-runs require a Scale plan or higher.                                             |
| `409`  | The template's build isn't `ready`. [Build it](/api-reference/templates/build) first. |
| `429`  | Run-VM rate limit or concurrency cap reached. Back off and retry.                     |


## OpenAPI

````yaml POST /templates/run
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/run:
    post:
      tags:
        - Templates
      summary: Test-run a template
      description: >-
        Boots a short-lived, auto-reaped preview computer from a template ref -
        the in-editor test run. Requires a Scale plan. For a persistent
        computer, use POST /computers with template_ref instead.
      operationId: testRunTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ref
              properties:
                ref:
                  type: string
                  example: default/my-template@1.0.0
      responses:
        '200':
          description: Preview computer booted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateRunResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Test-runs require a Scale plan or higher
        '409':
          description: The template's build is not ready
        '429':
          description: Run-VM rate limit or concurrency cap reached
components:
  schemas:
    TemplateRunResponse:
      type: object
      description: >-
        A short-lived preview computer booted from a template ref. Connect to it
        like any computer; it is auto-reaped.
      properties:
        id:
          type: string
          description: Underlying VM id.
        desktop_id:
          type: string
          description: >-
            Ephemeral desktop id. Use it for same-origin connection URLs and to
            stop the run via DELETE /templates/run?id=.
        status:
          type: string
        vnc_password:
          type: string
        public_host:
          type: string
        resolution:
          type: string
    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

````