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

# Set sleep when idle

> Set how many idle minutes pass before the computer goes to sleep.

Sets how many idle minutes pass before the computer goes to sleep: no screen, API or network activity for that long. Send a whole number of minutes, or `0` for never. See [Sleep when idle](https://docs.orgo.ai/guides/computer-settings.md#sleep-when-idle).

A sleeping computer keeps its memory and wakes on its next action, or with [Resume](https://docs.orgo.ai/api-reference/computers/resume.md). Paid plans only; the free plan answers `403`.


## OpenAPI

````yaml PATCH /computers/{id}/auto-stop
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: contact@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Support
    description: >-
      Orgo’s support agent, for programs: ask how to do something in Orgo and
      get an answer with full URLs and copyable commands.
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more. Residential data: what the account has left for
      residential IPs, and buying more from credits.
  - name: Agent accounts
    description: >-
      Accounts an AI agent makes for itself, and the claim link a person uses to
      take one over.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Public URLs
    description: Share an app running on a computer at an https address on orgo.dev.
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
  - name: Chat
    description: Run an agent on a computer through OpenAI-compatible chat completions.
  - name: Workflows
    description: >-
      Routines that run the same way every time: a start, then steps. Make them
      from plain words or lines, check them, run them and follow their runs (in
      preview).
paths:
  /computers/{id}/auto-stop:
    patch:
      tags:
        - Computers
      summary: Set sleep when idle
      description: >-
        Sets how many idle minutes pass before the computer goes to sleep. Idle
        means no screen, API or network activity. A sleeping computer keeps its
        memory and wakes on [Resume](/api-reference/computers/resume). Paid
        plans only.
      operationId: setComputerAutoStop
      parameters:
        - name: id
          in: path
          required: true
          description: Computer ID. Accepts the computer's UUID or its `instance_id`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - auto_stop_minutes
              properties:
                auto_stop_minutes:
                  type: integer
                  minimum: 0
                  description: >-
                    Whole minutes, or 0 for never. The dashboard offers 15, 30,
                    60, 120 and 240.
            example:
              auto_stop_minutes: 60
      responses:
        '200':
          description: Saved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  auto_stop_minutes:
                    type: integer
                  auto_suspend_after:
                    type: string
                    description: >-
                      The same value as a duration, such as `60m`, or `0s` for
                      never.
              example:
                auto_stop_minutes: 60
                auto_suspend_after: 60m
        '400':
          description: >-
            A bad value, or a computer that doesn't sleep (a Mac, a phone, a
            device).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                value:
                  summary: Bad value
                  value:
                    error: auto_stop_minutes must be a non-negative number
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: The free plan, or you can't change this computer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                free:
                  summary: Free plan
                  value:
                    error: Auto-stop is not configurable on the free plan
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The computer is asleep in storage. Wake it first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  This computer is asleep. Wake it to change its auto-stop
                  setting.
                code: computer_asleep
        '500':
          description: The setting couldn't be saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to update auto-stop setting
components:
  schemas:
    Error:
      type: object
      description: >-
        The base error body. Every failure carries `error`; individual endpoints
        add the fields named in the schemas below.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
          example: Access denied
        code:
          type: string
          description: >-
            Machine-readable reason. Present on the failures that define one,
            absent otherwise.
  responses:
    Unauthorized:
      description: 'No usable credential. Send `Authorization: Bearer $ORGO_API_KEY`.'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  docs:
                    type: string
                    format: uri
                    description: 'How to sign in: `https://www.orgo.ai/auth.md`.'
          examples:
            invalid-key:
              summary: The key is not one of yours
              value:
                error: Invalid API key
                docs: https://www.orgo.ai/auth.md
            no-credential:
              summary: No key and no session
              value:
                error: Authentication required
                docs: https://www.orgo.ai/auth.md
      headers:
        WWW-Authenticate:
          description: '`Bearer realm="Orgo API"`.'
          schema:
            type: string
    NotFound:
      description: >-
        No computer with this id on your account. With an API key the body
        carries `code: "computer_not_found"`; signed in with a session it is
        `Desktop not found`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            api-key:
              summary: API key
              value:
                error: Computer not found (computer_not_found).
                code: computer_not_found
            session:
              summary: Signed in with a session
              value:
                error: Desktop not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.