Quick Start
Copy
import { Instance } from '@in10nt/sdk';
const instance = await Instance.create({
name: 'quick-agent',
description: 'Web scraper'
});
const result = await instance.run('Build a web scraper for product prices');
console.log(result.response);
await instance.destroy();
Custom Environment
Copy
import { In10ntClient } from '@in10nt/sdk';
const client = new In10ntClient();
// Build custom template
const template = await client.templates.create({
name: 'python-ml',
image: 'python:3.11-slim',
registryType: 'dockerhub'
});
await template.waitUntilReady();
// Use template
const instance = await client.instances.create({
name: 'ml-agent',
description: 'ML tasks',
containerTemplateId: template.templateId
});
await instance.run('Train sentiment classifier on reviews.csv');
Multi-Step Conversation
Copy
const instance = await Instance.create({
name: 'web-builder',
description: 'REST API project'
});
await instance.run('Create REST API with user CRUD');
await instance.run('Add JWT authentication');
await instance.run('Write tests');
const changes = await instance.files.getChanges();
await instance.destroy();
Discord Bot (Moltbot)
Copy
const client = new In10ntClient();
const bot = await client.instances.create({
name: 'discord-bot',
description: 'My Discord bot',
agentType: 'moltbot',
integrations: ['Discord'],
integrationEnv: {
DISCORD_BOT_TOKEN: process.env.DISCORD_TOKEN,
DISCORD_GUILD_ID: '123456789',
DISCORD_CHANNEL_ID: '987654321'
}
});
// Bot automatically responds to Discord messages
// Also supports direct programmatic tasks:
await bot.run('Add a new slash command for server stats');
await bot.run('Improve the welcome message for new members');
Voice Agent (Twilio)
Copy
const client = new In10ntClient();
const voice = await client.instances.create({
name: 'phone-assistant',
description: 'Voice AI assistant',
integrations: ['Voice'],
integrationEnv: {
TWILIO_ACCOUNT_SID: process.env.TWILIO_SID,
TWILIO_AUTH_TOKEN: process.env.TWILIO_TOKEN,
TWILIO_FROM_NUMBER: '+1234567890',
ELEVENLABS_API_KEY: process.env.ELEVENLABS_KEY
}
});
// Handles inbound/outbound calls + programmatic tasks
await voice.run('Update the greeting message to be more friendly');
GitHub Automation
Copy
const client = new In10ntClient();
const agent = await client.instances.create({
name: 'gh-automation',
description: 'GitHub automation',
integrations: ['GitHub'],
integrationEnv: {
GITHUB_TOKEN: process.env.GITHUB_TOKEN
}
});
await agent.run('Clone my repo, add CI/CD workflow, and create PR');
Web App with Dev Server
Copy
const instance = await Instance.create({
name: 'web-app',
description: 'React app'
});
await instance.run('Create React + Vite app and start dev server on port 5173');
// Access at the proxy URL
const url = instance.getProxyUrl(5173);
console.log('Dev server:', url);
// Or list detected ports
const ports = await instance.ports.list();
console.log('Ports:', ports);
Background Task
Copy
const instance = await Instance.create({
name: 'data-processor',
description: 'Data processing'
});
// Start task in background (returns immediately)
const { taskId } = await instance.run('Process large dataset', {
background: true
});
// ... do other work ...
// Poll for completion later
const result = await instance.tasks.poll(taskId!);
console.log(result.response);
Clone Workspace
Copy
const client = new In10ntClient();
// Setup base workspace
const base = await client.instances.create({
name: 'base',
description: 'Base project'
});
await base.run('Setup project with dependencies');
// Snapshot the workspace
await base.snapshot();
// Clone from saved template
const clone = await client.instances.createFromSavedTemplate({
templateName: 'base',
newInstanceName: 'clone-1'
});
await clone.run('Continue building on the base project');
Configurable Run Options
Copy
const instance = await Instance.create({
name: 'configurable',
description: 'Custom options demo'
});
const result = await instance.run('Build a REST API', {
model: 'anthropic/claude-sonnet-4.5',
timeout: 300_000,
pollInterval: 5_000,
maxPollTime: 120_000,
healthCheckRetries: 20,
healthCheckDelay: 3_000,
maxTokens: 4096,
system: 'You are a senior engineer. Write production-ready code.',
});
console.log(result.response);
Error Handling
Copy
import { Instance, TimeoutError, HealthCheckError, In10ntError } from '@in10nt/sdk';
try {
const instance = await Instance.create({
name: 'safe-agent',
description: 'Error handling demo'
});
const result = await instance.run('Build something', {
timeout: 60_000
});
console.log(result.response);
await instance.destroy();
} catch (err) {
if (err instanceof TimeoutError) {
console.error('Timed out:', err.message);
} else if (err instanceof HealthCheckError) {
console.error('Not healthy:', err.message);
} else if (err instanceof In10ntError) {
console.error('API error:', err.statusCode, err.message);
}
}
Logger
Copy
import { Instance, createConsoleLogger } from '@in10nt/sdk';
// Opt-in to see SDK debug output
const instance = await Instance.create(
{ name: 'debug-agent', description: 'Debug demo' },
{ logger: createConsoleLogger() }
);

