Bytebot API Overview
Bytebot provides two main APIs for programmatic control:1. Agent API (Task Management)
The Agent API runs on port 9991 and provides high-level task management:Task Management
Create, manage, and monitor AI-powered tasks programmatically
UI Integration
WebSocket connections and real-time updates for custom UIs
Agent API Base URL
Example Task Creation
2. Desktop API (Direct Control)
The Desktop API runs on port 9990 and provides low-level desktop control:Computer Control
Direct control of mouse, keyboard, and screen capture
Usage Examples
Code examples for common automation scenarios
Desktop API Base URL
Example Desktop Control
MCP Support
The Desktop API also exposes an MCP (Model Context Protocol) endpoint:Authentication
- Local Access: No authentication required by default
- Remote Access: Configure authentication based on your security requirements
- Production: Implement API keys, OAuth, or other authentication methods
Response Formats
Agent API Response
Desktop API Response
Error Handling
Both APIs use standard HTTP status codes:Status Code | Description |
---|---|
200 | Success |
201 | Created (new resource) |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Authentication failed |
404 | Not Found - Resource doesn’t exist |
500 | Internal Server Error |
Rate Limiting
- Agent API: No hard limits, but consider task queue capacity
- Desktop API: No rate limiting, but rapid actions may impact desktop performance
Best Practices
- Use Agent API for high-level automation - Let the AI handle complexity
- Use Desktop API for precise control - When you need exact actions
- Combine both APIs - Create tasks via Agent API, monitor via Desktop API
- Handle errors gracefully - Implement retry logic for transient failures
- Monitor resource usage - Both APIs can be resource-intensive