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

# XUNA AI Conversational AI REST API: getting started

> Everything you need to get started with the XUNA AI Conversational AI REST API: base URL, authentication, SDK setup, and rate limits.

The XUNA AI Conversational AI API lets you create and manage voice agents, retrieve conversation history, and control telephony integrations — all over HTTP. Every endpoint is available under a single base URL and secured with an API key.

## Base URL

All API requests go to:

```
https://api.xuna.ai
```

## Authentication

Pass your API key in the `x-api-key` request header on every call:

```bash theme={null}
curl https://api.xuna.ai/v1/convai/agents \
  -H "x-api-key: YOUR_API_KEY"
```

Get your API key from [**Settings → API Keys**](https://xuna.ai/app/settings/api-keys). Store it as an environment variable rather than hard-coding it:

```bash theme={null}
export XUNA_AI_API_KEY=your_api_key_here
```

See [Authentication](/api-reference/authentication) for advanced options including signed URLs and conversation tokens for client-side use.

## SDK installation

The official SDKs wrap every endpoint and handle authentication automatically.

<CodeGroup>
  ```bash Python theme={null}
  pip install xuna-ai
  ```

  ```bash TypeScript theme={null}
  npm install @xuna-ai/xuna-ai-js
  ```
</CodeGroup>

Initialize the client with your API key:

<CodeGroup>
  ```python Python theme={null}
  from xuna_ai.client import XunaAI

  client = XunaAI(api_key="YOUR_API_KEY")
  ```

  ```typescript TypeScript theme={null}
  import { XunaAIClient } from "@xuna-ai/xuna-ai-js";

  const client = new XunaAIClient({ apiKey: "YOUR_API_KEY" });
  ```
</CodeGroup>

<Tip>
  Set the `XUNA_AI_API_KEY` environment variable and the SDKs will pick it up automatically — no need to pass `api_key` explicitly.
</Tip>

## Rate limits

<Note>
  Rate limits vary by plan. If you exceed your limit, the API returns a `429 Too Many Requests` response. Implement exponential backoff and retry logic in production applications.
</Note>

## Explore the API

<CardGroup cols={2}>
  <Card title="Agents" icon="robot" href="/api-reference/agents/create">
    Create, update, list, and delete voice agents.
  </Card>

  <Card title="Conversations" icon="messages" href="/api-reference/agents/conversations">
    Retrieve transcripts, audio, and evaluation results.
  </Card>

  <Card title="Phone numbers" icon="phone" href="/api-reference/telephony/phone-numbers">
    Import Twilio numbers and assign agents to inbound calls.
  </Card>

  <Card title="Batch calls" icon="phone-volume" href="/api-reference/telephony/batch-calls">
    Launch outbound call campaigns with per-call overrides.
  </Card>
</CardGroup>
