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

# Close client

> Close a client. Their key stops working at once.

Delete their computers first: closing never deletes a computer for you.

Use your account-wide API key. A client’s own key gets `403` here. See [Invoicing](https://docs.orgo.ai/guides/invoicing.md).

## Path parameters

**id** `string` *required*

The client’s `id`.

## Response

The client, with `status` `closed` and `computers` `[]`. Closing a client that is already closed or transferred returns it unchanged with `200`.

## Example

```bash cURL theme={null}
curl -X DELETE https://www.orgo.ai/api/v1/accounts/$CLIENT_ID \
  -H "Authorization: Bearer $ORGO_API_KEY"
```

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

client_id = os.environ["CLIENT_ID"]

res = requests.delete(
    f"https://www.orgo.ai/api/v1/accounts/{client_id}",
    headers={"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"},
)
print(res.json())
```

```javascript JavaScript theme={null}
const clientId = process.env.CLIENT_ID;

const res = await fetch(`https://www.orgo.ai/api/v1/accounts/${clientId}`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.ORGO_API_KEY}` },
});
console.log(await res.json());
```

### Response

```json theme={null}
{
  "id": "8f14e45f-ceea-467a-9575-6f1c2b3d4e5f",
  "external_id": "acme-dental",
  "name": "Acme Dental",
  "status": "closed",
  "workspace_id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": "2026-10-01T09:00:00Z",
  "closed_at": "2026-10-20T15:00:00Z",
  "limits": {
    "max_computers": 3,
    "monthly_ai_cap_usd": 40
  },
  "usage": {
    "computers": 0,
    "ai_spend_usd_this_month": 0
  },
  "billing": {
    "status": "active",
    "price_usd": 250,
    "email": "billing@acme.com"
  },
  "transfer": null,
  "computers": []
}
```

## Errors

| Status | Body | Meaning |
| - | - | - |
| `401` | `{ "error": "Invalid API key" }` | No key, or not one of yours. |
| `403` | `{ "error": "Use your account-wide API key to manage accounts. Workspace keys can’t." }` | A client’s own key, or any key scoped to one workspace. |
| `403` | `{ "error": "Invoicing is on every paid plan. Upgrade to use it." }` | You’re on the Free plan. `code` is `UPGRADE_REQUIRED`. |
| `403` | `{ "error": "Invoicing isn’t available on this account. Contact Orgo." }` | Orgo turned invoicing off for this account. `code` is `MANAGED_ACCOUNTS_DISABLED`. |
| `404` | `{ "error": "Account not found." }` | No client with this id is yours. |
| `409` | `{ "error": "This account still has 2 computers. Delete them first." }` | `code` is `ACCOUNT_HAS_COMPUTERS`. |
| `429` | `{ "error": "Too many API requests this minute (600 a minute on your plan). Try again in 30 seconds.", "code": "rate_limited", "limit": "api_other_per_minute", "retry_after": 30 }` | Your account's plan rate limit for other API calls. `limit` is `api_other_per_minute`. Carries a `Retry-After` header with the seconds to wait. Refused before the request runs. See [Plan rate limits](https://docs.orgo.ai/guides/account-limits.md#plan-rate-limits). |


## OpenAPI

````yaml DELETE /v1/accounts/{id}
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:
  /v1/accounts/{id}:
    delete:
      tags:
        - Clients
      summary: Close client
      description: >-
        Close a client. Their key stops working at once. A client already closed
        or transferred is returned unchanged. Closing an active client returns
        `computers: []`.
      operationId: closeClient
      parameters:
        - name: id
          in: path
          required: true
          description: The client’s `id`.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              example:
                id: 8f14e45f-ceea-467a-9575-6f1c2b3d4e5f
                external_id: acme-dental
                name: Acme Dental
                status: closed
                workspace_id: 550e8400-e29b-41d4-a716-446655440000
                created_at: '2026-10-01T09:00:00Z'
                closed_at: '2026-10-20T15:00:00Z'
                limits:
                  max_computers: 3
                  monthly_ai_cap_usd: 40
                usage:
                  computers: 0
                  ai_spend_usd_this_month: 0
                billing:
                  status: active
                  price_usd: 250
                  email: billing@acme.com
                transfer: null
              schema:
                $ref: '#/components/schemas/Client'
        '401':
          description: No key, or not one of yours.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e1:
                  summary: No key, or not one of yours
                  value:
                    error: Invalid API key
        '403':
          description: >-
            A client’s own key, or any key scoped to one workspace. You’re on
            the Free plan. `code` is `UPGRADE_REQUIRED`. Invoicing is off for
            this account. `code` is `MANAGED_ACCOUNTS_DISABLED`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e1:
                  summary: A client’s own key, or any key scoped to one workspace
                  value:
                    error: >-
                      Use your account-wide API key to manage accounts.
                      Workspace keys can’t.
                e2:
                  summary: You’re on the Free plan
                  value:
                    error: Invoicing is on every paid plan. Upgrade to use it.
                disabled:
                  summary: Invoicing is off for this account
                  value:
                    error: Invoicing isn’t available on this account. Contact Orgo.
                    code: MANAGED_ACCOUNTS_DISABLED
        '404':
          description: No client with this id is yours.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e1:
                  summary: No client with this id is yours
                  value:
                    error: Account not found.
        '409':
          description: '`code` is `ACCOUNT_HAS_COMPUTERS`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e1:
                  summary: '`code` is `ACCOUNT_HAS_COMPUTERS`'
                  value:
                    error: This account still has 2 computers. Delete them first.
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Client:
      type: object
      description: 'A client: a workspace you run for them, with a key scoped to it.'
      properties:
        id:
          type: string
        external_id:
          type: string
        name:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - active
            - closed
            - transferred
        workspace_id:
          type: string
        created_at:
          type: string
          format: date-time
        closed_at:
          type: string
          format: date-time
          nullable: true
        limits:
          type: object
          properties:
            max_computers:
              type: integer
              nullable: true
            monthly_ai_cap_usd:
              type: number
              nullable: true
        usage:
          type: object
          properties:
            computers:
              type: integer
            ai_spend_usd_this_month:
              type: number
        billing:
          type: object
          nullable: true
          properties:
            status:
              type: string
              enum:
                - sent
                - active
                - past_due
            price_usd:
              type: number
            email:
              type: string
        transfer:
          type: object
          nullable: true
          properties:
            email:
              type: string
            sent_at:
              type: string
              format: date-time
        computers:
          type: array
          description: Up to 50, newest first. Not on Add a client or List clients.
          items:
            type: object
    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.
    RateLimited:
      type: object
      required:
        - error
        - code
        - limit
        - retry_after
      properties:
        error:
          type: string
          description: Which limit, in plain words, and when to try again.
        code:
          type: string
          const: rate_limited
        limit:
          type: string
          enum:
            - computer_create_per_minute
            - computer_create_per_hour
            - computer_create_per_day
            - computer_lifecycle_per_minute
            - computer_lifecycle_per_computer_per_minute
            - computer_control_per_minute
            - computer_control_per_computer_per_minute
            - chat_runs_per_minute
            - chat_runs_concurrent
            - workspace_create_per_hour
            - api_other_per_minute
        retry_after:
          type: integer
          minimum: 1
          description: Seconds to wait.
      example:
        error: >-
          Too many API requests this minute (120 a minute on your plan). Try
          again in 12 seconds.
        code: rate_limited
        limit: api_other_per_minute
        retry_after: 12
  responses:
    RateLimited:
      description: >-
        Over one of the account's plan rate limits (`rate_limited`): `limit`
        names it, and `retry_after` and `Retry-After` say how many seconds to
        wait. Limits are per account, the workspace owner's when the request
        acts on a computer or a workspace, and set by its plan. See [Account
        limits and rate limits](/guides/account-limits#plan-rate-limits).
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimited'
  headers:
    RetryAfter:
      description: Seconds to wait before asking again.
      schema:
        type: integer
        minimum: 1
    RateLimitLimit:
      description: The tightest limit this request counts against.
      schema:
        type: integer
    RateLimitRemaining:
      description: How many are left of it in this window.
      schema:
        type: integer
    RateLimitReset:
      description: Seconds until its window starts again.
      schema:
        type: integer
  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.