Agents/Documentation

Agent SDK Documentation

Complete guide to building and deploying AI agents

Overview

OOretz Agents are autonomous AI systems that can perform complex tasks on your behalf. They can control computers, browse the web, write code, and more.

🖥️

Computer Agent

Control mouse, keyboard, files, and applications

🌐

Web Agent

Browse, interact, and extract from websites

💻

Code Agent

Write, debug, test, and deploy code

Quick Start

1. Install the SDK

# JavaScript/TypeScript
npm install @ooretz/agent-sdk

# Python
pip install ooretz

2. Initialize with your API key

import { OOretz } from '@ooretz/agent-sdk';

const ooretz = new OOretz({
  apiKey: process.env.OORETZ_API_KEY
});

3. Create and run an agent

// Create a web agent
const agent = await ooretz.agents.create({
  name: 'My Web Scraper',
  type: 'web'
});

// Run a task
const result = await agent.run({
  task: 'Go to example.com and extract the main heading'
});

console.log(result.data);

Computer Agent

The Computer Agent can control your desktop environment, execute commands, and interact with applications.

Available Actions

ActionDescriptionParameters
execute_commandRun a shell commandcommand: string
read_fileRead file contentspath: string
write_fileWrite to a filepath, content: string
mouse_clickClick at coordinatesx, y: number
keyboard_typeType texttext: string
take_screenshotCapture screenregion?: object

Example

const computer = await ooretz.agents.create({ type: 'computer' });

await computer.run({
  task: "Open Terminal and create a new project folder",
  steps: [
    { action: 'open_application', app: 'Terminal' },
    { action: 'keyboard_type', text: 'mkdir my-project && cd my-project' },
    { action: 'keyboard_press', key: 'Enter' }
  ]
});

Web Agent

The Web Agent uses a headless browser to navigate websites and perform web automation tasks.

Configuration

const webAgent = await ooretz.agents.create({
  type: 'web',
  config: {
    headless: true,        // Run without visible browser
    viewport: { width: 1920, height: 1080 },
    timeout: 30000,        // 30 second timeout
    userAgent: 'custom',   // Custom user agent
    proxy: 'http://...',   // Optional proxy
  }
});

Available Actions

ActionDescription
navigateGo to a URL
clickClick an element by selector
fillFill a form field
extractExtract data from elements
screenshotTake a screenshot
evaluateExecute JavaScript
waitWait for element/condition

API Reference

Base URL: https://api.ooretz.space

POST/v1/agents

Create a new agent

{
  "name": "My Agent",
  "type": "web",
  "config": {...}
}
GET/v1/agents

List all agents

GET/v1/agents/:id

Get agent details

POST/v1/agents/:id/run

Run an agent with a task

{
  "task": "Your task description",
  "parameters": {...},
  "mode": "auto"
}
GET/v1/agents/:id/runs

Get agent run history

GET/v1/agents/:id/runs/:runId

Get specific run details and logs

POST/v1/agents/:id/runs/:runId/stop

Stop a running agent

DELETE/v1/agents/:id

Delete an agent

Official SDKs

📦JavaScript/TypeScript
npm install @ooretz/agent-sdk
🐍Python
pip install ooretz
🔷Go
go get github.com/ooretz/agent-go
💎Ruby
gem install ooretz

Webhooks

Receive real-time notifications when agent tasks complete or encounter errors.

// Configure webhook in agent settings
const agent = await ooretz.agents.create({
  type: 'web',
  webhooks: {
    onComplete: 'https://your-server.com/webhook/complete',
    onError: 'https://your-server.com/webhook/error',
    onStep: 'https://your-server.com/webhook/step'  // Optional: each step
  }
});

// Webhook payload
{
  "event": "agent.run.completed",
  "agentId": "agent_123",
  "runId": "run_456",
  "result": { ... },
  "timestamp": "2024-01-15T10:30:00Z"
}