> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentline.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an agent, buy a number, and make your first call.

# Quickstart

## 1. Get an API key

AgentLine uses email one-time codes for sign-up and sign-in (no dashboard
required).

```bash Request a code theme={null}
curl -X POST https://api.agentline.cloud/v1/auth/otp \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'
```

```bash Verify and get a key theme={null}
curl -X POST https://api.agentline.cloud/v1/auth/verify \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "otp": "123456"}'
```

The verify response returns `api_key` (shown once â€” store it). New accounts
start with a $0 balance. Your first US or Canada number is free and starts a
7-day trial with 10 call minutes and 10 SMS. Recharge or pick a plan to keep
the trial number; use
an included subscription number or add credit before buying an additional
number ($3.00/month).

## 2. Call the API

Python is published as `agentline-ai`. The Node package is not on npm yet, so
the JavaScript example uses `fetch`.

```python theme={null}
from agentline_ai import AgentLine

client = AgentLine(api_key="al_live_...")

agent = client.agents.create(
    name="Support Bot",
    system_prompt="You are a helpful assistant.",
    initial_greeting="Hello! How can I help?",
)
client.numbers.buy(agent_id=agent.id, country="US", area_code="415")
call = client.calls.create(agent_id=agent.id, to_number="+12125557890")

print("Call started:", call.id)
```

```javascript theme={null}
const headers = {
  Authorization: "Bearer al_live_...",
  "Content-Type": "application/json",
};

const agent = await fetch("https://api.agentline.cloud/v1/agents", {
  method: "POST",
  headers,
  body: JSON.stringify({
    name: "Support Bot",
    system_prompt: "You are a helpful assistant.",
    initial_greeting: "Hello! How can I help?",
  }),
}).then((res) => res.json());

await fetch("https://api.agentline.cloud/v1/numbers", {
  method: "POST",
  headers,
  body: JSON.stringify({ agent_id: agent.id, country: "US", area_code: "415" }),
});

const call = await fetch("https://api.agentline.cloud/v1/calls", {
  method: "POST",
  headers,
  body: JSON.stringify({ agent_id: agent.id, to_number: "+12125557890" }),
}).then((res) => res.json());

console.log("Call started:", call.id);
```

## 3. Install live event delivery

If the agent has terminal access, download and install the persistent relay:

```bash theme={null}
curl -fsSL https://api.agentline.cloud/static/agentline_relay.py -o agentline_relay.py
python agentline_relay.py install --agent-id agt_xxx
```

The installer detects Hermes, OpenClaw, Claude Code, or Codex, preserves one
runtime session per phone call, reconnects automatically, and installs a user
service. Runtime package/service installation may require one safety approval.
Use a [webhook](https://docs.agentline.cloud/guides/webhooks.md) if the agent cannot run a persistent process.

## 4. Get the results

Use the relay for live turns and durable event delivery. Poll the mailbox only
as a fallback, or receive non-live events via webhook.

```python theme={null}
events = client.events.poll()
```

```javascript theme={null}
const events = await fetch("https://api.agentline.cloud/v1/events", {
  headers: { Authorization: "Bearer al_live_..." },
}).then((res) => res.json());
```

> [!TIP]
>
> All phone numbers are E.164 format, e.g. `+12125557890`. Numbers are US or Canada.
> Plan-included numbers use the allowance first; additional numbers cost \$3.00/month
> each. Each agent can have one active number at a time.

Next: read [Authentication](https://docs.agentline.cloud/authentication.md) and the [Agents guide](https://docs.agentline.cloud/guides/agents.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.