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

# Node SDK

> The Node SDK is not on npm yet. Call the REST API with fetch.

# Node SDK

The Node package is not on npm yet. `npm i agentline` returns 404. Call the
REST API with `fetch` until a package is published. Python is
`pip install agentline-ai` (`from agentline_ai import AgentLine`).

## Resources

```typescript theme={null}
client.agents     // create, list, get, update, delete
client.numbers    // buy, list, get, attach, reassign, release (destructive)
client.calls      // create, list, get, getTranscript, hangup, pushContext
client.messages   // list, listConversations
client.events     // poll, peek
client.webhooks   // list, set, delete, test
client.billing    // getBalance, getExpenditure, getSummary, ...
client.voice      // list, get, set, reset
```

## Create an agent and place a call

```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 you today?",
  }),
}).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());

await fetch(`https://api.agentline.cloud/v1/calls/${call.id}/hangup`, {
  method: "POST",
  headers,
});

const transcript = await fetch(
  `https://api.agentline.cloud/v1/calls/${call.id}/transcript`,
  { headers },
).then((res) => res.json());

console.log(transcript);
```

US numbers cost \$2.00/month per number. Voice calls are \$0.10/minute in both
directions. A 0-second call is free. A connected call has a one-minute minimum,
then the actual duration, rounded up to the cent.


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