Skip to Content
APIAPI Overview

Computer Agents API

The Computer Agents API is a REST API for building, deploying, and managing AI-powered agents that can write code, execute commands, and manage files in isolated cloud environments.

Base URL

https://api.computer-agents.com/v1

All endpoints use the /v1 prefix. The API follows REST conventions with JSON request/response bodies.

Quick Start

Create a thread and execute a task in a single request:

curl -X POST https://api.computer-agents.com/v1/threads \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [{ "role": "user", "content": "Create a hello.py file" }], "stream": true }'

This returns a Server-Sent Events stream with real-time progress and results.

API Resources

Core Concepts

User-Scoped Architecture

All resources belong to the authenticated user. No project IDs in URLs - your API key determines resource ownership.

GET /v1/threads # Your threads GET /v1/agents # Your agents GET /v1/environments # Your environments

Threads (Unified API)

Threads are the primary interface for agent interactions. The API intelligently determines behavior based on what you provide:

RequestBehavior
Messages onlyExecute immediately (SSE stream)
Messages + scheduleCreate scheduled task
No messagesCreate empty thread

Environments

Environments define how agents execute. Configure once, use across all threads:

  • Environment variables and secrets
  • MCP servers for external tools
  • Setup scripts
  • Network access controls

Files

Each environment has an isolated workspace for files:

  • Upload, download, and delete files
  • Create directories
  • Bulk upload support
  • Backed by Google Cloud Storage

Agents

Agents define LLM behavior. Customize model, instructions, and capabilities:

  • Model selection (GPT-4, etc.)
  • System instructions
  • Reasoning effort level
  • Enabled skills

Response Format

List Endpoints

All list endpoints return a standardized format:

{ "object": "list", "data": [...], "has_more": false, "total_count": 42 }

Single Resources

Single resource responses wrap the resource:

{ "thread": { "id": "thread_xxx", "status": "active", ... } }

Errors

Error responses include type and message:

{ "error": "Bad Request", "message": "Missing required field: content" }

Authentication

Include your API key in every request:

# Bearer token (recommended) Authorization: Bearer tb_xxxxxxxxxxxx # Or X-API-Key header X-API-Key: tb_xxxxxxxxxxxx

View Authentication Guide →

Rate Limits

LimitValue
Global1,000 requests / 15 minutes
ExecutionSubject to budget balance

Budget System

Each user has a budget with:

  • Starting balance: $10.00
  • Daily/monthly limits: Configurable

Budget is checked before execution. HTTP 402 returned when exhausted.

View Billing Guide →

SDKs

TypeScript/JavaScript

npm install computer-agents
import { ComputerAgentsClient } from 'computer-agents'; const client = new ComputerAgentsClient({ apiKey: process.env.COMPUTER_AGENTS_API_KEY }); const result = await client.run('Create a REST API', { environmentId: 'env_xxx', onEvent: (event) => console.log(event.type) }); console.log(result.content);

View SDK Guide →

Last updated on