# Sai API

What the Sai API is and how a request flows through it.

The Sai API lets your code or your coding agent hand a task to Sai, a computer-use agent that works on a real Windows or macOS computer. You send a message, Sai works on the computer, and you read the result.

## Which Simular API is this

This site documents three things that are easy to confuse:

| You want to                                                                            | Use                                                                       |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| Hand a task in plain language to Sai, running on a cloud or linked computer            | **Sai API** (this tab)                                                    |
| Script a Mac yourself with the `simulang` CLI, or from Claude Code on your own machine | [Simulang with Claude Code](/simulang/simulang-claude-code)               |
| Trigger a saved Simular Pro action with curl                                           | [Simular Pro: use curl](/simular-pro/use-curl-to-trigger-action) (legacy) |

## Base URL

```
https://api.simular.ai/v1/agents
```

The portal, where you sign in and create API keys, is [platform.simular.ai](https://platform.simular.ai).

## How a request flows

1. You `POST /message` with a task. With `wait: false` the API answers at once with a `sessionId`.
2. Sai works on the computer. You `GET /events` to read progress, text and approval requests.
3. When Sai needs permission, an event of type `data-approval-request` arrives. You answer it with `POST /approve`, or you open its `approvalUrl` in a browser when a human has to act.
4. When `status` is `idle`, `text` holds the result.

Every call carries `Authorization: Bearer sapi_...`. See [Authentication](/documentation/api-reference/authentication).

## Two ways to use it

- **HTTP.** Any language. Start with the [Quickstart](/documentation/quickstart) and the [examples](/documentation/examples/curl).
- **A coding agent.** Claude Code, Codex and Cursor call Sai through the `@simular-ai/sai-mcp` server. One command installs it. See [Claude Code](/documentation/coding-agents/claude-code).

## What you get

- A computer. Paid accounts see their own registered machines. Free accounts get one pooled Windows cloud computer. See [Computers](/documentation/concepts/computers).
- One conversation per computer on the API channel. Follow-up messages continue it. See [Sessions](/documentation/concepts/sessions).
- No model keys to bring. The model and the computer are included in your Sai plan. See [Billing and limits](/documentation/concepts/billing-and-limits).

## Streaming or polling

`POST /message` with `wait: true` (the default) streams events over Server-Sent Events. Use it from a browser or a long-lived process. Coding agents and short scripts should send `wait: false` and poll `/events`. Both paths carry the same [event vocabulary](/documentation/api-reference/events).
