> For the complete documentation index, see [llms.txt](https://hallway.gitbook.io/embed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hallway.gitbook.io/embed/cloud-agent-api/api.md). Agents can also search and read this documentation through its [MCP server](https://hallway.gitbook.io/embed/~gitbook/mcp).

# Overview and Quickstart

Send tasks to your Hallway cloud agent from your own code, AI tools, email, or text.

Each Hallway team has one cloud browser that we host for you, signed into the websites you choose. The Cloud Agent API lets you hand it a task in plain language and get the answer back. Hallway handles the browsing: finding pages, clicking, reading, typing, and writing saved [Docs](https://hallway.ai/app/docs).

You can also point tasks at a browser you host, such as a [Browserbase](https://www.browserbase.com) session. See [Bring Your Own Browser](https://hallway.gitbook.io/embed/cloud-agent-api/bring-your-own-browser.md).

There are four ways to connect:

<table data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td><strong>HTTP API</strong></td><td>Call Hallway from your server, scripts, or another agent.</td><td><a href="https://hallway.gitbook.io/embed/cloud-agent-api/run-a-task.md">Run a Task</a></td></tr><tr><td><strong>MCP</strong></td><td>Use Hallway as a tool in Cursor, Claude Code, Codex, and other AI clients.</td><td><a href="https://hallway.gitbook.io/embed/cloud-agent-api/mcp.md">Connect with MCP</a></td></tr><tr><td><strong>Email</strong></td><td>Email a task and get the result back in your inbox.</td><td><a href="https://hallway.gitbook.io/embed/cloud-agent-api/email.md">Run Tasks by Email</a></td></tr><tr><td><strong>Text</strong></td><td>Text a task from your phone and get the reply by SMS.</td><td><a href="https://hallway.gitbook.io/embed/cloud-agent-api/sms.md">Run Tasks by Text</a></td></tr></tbody></table>

## Quickstart

{% stepper %}
{% step %}

### Set up your browser

Open [Cloud Agent](https://hallway.ai/app) in Hallway and choose **Personal** or a shared team. Sign into any websites you want the agent to use, including sign-in popups like **Continue with Google**. The agent uses these same logins when you call it through the API.
{% endstep %}

{% step %}

### Copy your API key

Under **Connect your app to Hallway** on [Cloud Agent](https://hallway.ai/app), click **Copy** to grab your team's API key, or go to [hallway.ai/app/developer](https://hallway.ai/app/developer) to view or rotate it.

Save it on your server as `HALLWAY_API_KEY`. Or click **Copy setup prompt** under **For your coding agent** to paste a ready-to-run prompt into Cursor, Claude Code, or Codex that connects MCP and runs a quick verification automatically.
{% endstep %}

{% step %}

### Run your first task

The **cURL** tab under **Connect your app to Hallway** shows a ready-to-copy request:

```bash
curl -iN "https://hallway.ai/api/v1/agent/run" \
  -H "Authorization: Bearer $HALLWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task":"Reply with exactly: Hallway API works."}'
```

The agent's progress streams back line by line. The last line says how the run ended and contains the answer:

```json
{"type":"run.completed","status":"completed","answer":"Hallway API works."}
```

To get the answer back as JSON fields instead of text, see [Structured Results](https://hallway.gitbook.io/embed/cloud-agent-api/structured-results.md).
{% endstep %}

{% step %}

### Keep the conversation going

The response includes an `X-Hallway-Session` header. Send it back as `sessionId` to ask a follow-up in the same conversation. See [Continue a conversation](https://hallway.gitbook.io/embed/cloud-agent-api/run-a-task.md#continue-a-conversation).
{% endstep %}
{% endstepper %}

## Endpoints

All requests go to `https://hallway.ai` and need your API key.

| Method | Endpoint                                  | Description                                                                                    |
| ------ | ----------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `POST` | `/api/v1/agent/run`                       | [Run a task](https://hallway.gitbook.io/embed/cloud-agent-api/run-a-task.md)                   |
| `GET`  | `/api/v1/agent/conversations/{sessionId}` | [Read a conversation](https://hallway.gitbook.io/embed/cloud-agent-api/read-a-conversation.md) |

{% hint style="warning" %}
The agent acts on real websites with your logins. Don't automatically retry a task that timed out. It may have already finished. See [Errors and Limits](https://hallway.gitbook.io/embed/cloud-agent-api/errors-and-limits.md).
{% endhint %}
