Guides

Get Started With the @autenai/sdk in 5 Minutes

Install the SDK, connect a device, and run your first natural-language task on a real Android phone. Includes CLI and code examples, polling, credentials, and webhooks.

A

Auten Team

May 31, 20266 min read
A glowing indigo terminal with code merging into a smartphone

The fastest way to drive an Android phone from your own code is the official SDK. Here is the entire loop — install, connect, run, and handle results — in about five minutes, with copy-paste examples.

1. Install the CLI + SDK

bash
npm i -g @autenai/sdk
auten login sk_live_...   # your API key from auten.ai

2. Connect a device

Pair your own Android over USB, or provision a hosted virtual device from the dashboard. The CLI walks you through accessibility and input-method setup automatically, including the quirks of vendors like Xiaomi/MIUI.

bash
auten add-phone           # interactive USB pairing
auten devices             # list your connected devices

3. Run your first task from the CLI

bash
auten task "open the calculator and compute 7 x 8"

4. Drive it from your code

The SDK is a thin, typed wrapper over the REST API:

javascript
import { Auten } from '@autenai/sdk';

const auten = new Auten({ apiKey: process.env.AUTEN_API_KEY });

// pick the first online device
const device = await auten.devices.firstOnline();

// send a natural-language task
const task = await auten.tasks.create({
  device: device.serial,
  prompt: 'check my unread email count and report the number',
});

console.log(task.task_id);

5. Poll for the result

javascript
let t = await auten.tasks.get(task.task_id);
while (t.status === 'running') {
  await new Promise(r => setTimeout(r, 1500));
  t = await auten.tasks.get(task.task_id);
}
console.log(t.status, t.result?.summary);

6. Handle logins with stored credentials

For tasks that need to sign in, store credentials encrypted per device once, then reference them by service name in your prompt — never embed passwords in the prompt itself. The agent decrypts and types them only at the moment of login.

7. Use webhooks for long tasks

Instead of polling, pass a webhook URL when you create a task and get notified when it finishes — handy for long or scheduled jobs running on hosted virtual devices.

Repeat tasks are free

Once a task succeeds, Auten replays the learned plan with no AI call. Your common flows get faster and cheaper the more you run them — see how the learning loop works.

Where to go next

Frequently asked questions

What runtime does the SDK need?

Node 18+ for the @autenai/sdk. Any language can use the REST API directly.

Do I need a physical phone to start?

No — the free tier includes a physical phone slot, but you can also provision a hosted virtual device and never touch hardware.

How do I keep API keys safe?

Store them in environment variables or a secret manager, never in source control, and rotate them from the dashboard if exposed.

Try Auten

Grab an API key at auten.ai, connect a phone or spin up a hosted virtual device, and send your first natural-language task in minutes. The free tier needs no credit card.

Share this article