> ## 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).

<CodeGroup>
  ```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"}'
  ```
</CodeGroup>

The verify response returns `api_key` (shown once â€” store it). New accounts
get a sign-up credit to start.

## 2. Use the SDK

<CodeGroup>
  ```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}
  import { AgentLineClient } from "agentline";

  const client = new AgentLineClient({ apiKey: "al_live_..." });

  const agent = await client.agents.create({
      name: "Support Bot",
      systemPrompt: "You are a helpful assistant.",
      initialGreeting: "Hello! How can I help?",
  });
  await client.numbers.buy({ agentId: agent.id, country: "US", areaCode: "415" });
  const call = await client.calls.create({ agentId: agent.id, toNumber: "+12125557890" });

  console.log("Call started:", call.id);
  ```
</CodeGroup>

## 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](/guides/webhooks) 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.

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

  ```javascript theme={null}
  const events = await client.events.poll();
  ```
</CodeGroup>

<Tip>
  All phone numbers are E.164 format, e.g. `+12125557890`. Each agent can have
  one active number at a time.
</Tip>

Next: read [Authentication](/authentication) and the [Agents guide](/guides/agents).
