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

# Build with an AI coding agent

> Install the Plivo Audio Streaming skill so Claude Code, Cursor or Codex know how to connect your WebSocket voice bot to phone calls, check it is ready, and debug a call that fails.

Plivo publishes a skill for AI coding agents such as Claude Code, Cursor and Codex. Install it once, and your agent knows how to connect a WebSocket voice bot to phone calls with Audio Streaming: the `<Stream>` XML, the checks to run before the first call, and how to debug a call that fails. A skill is a set of instructions your agent loads on its own when the task matches, so you keep working the way you already do.

## Install

<Info>
  The skill drives Plivo through the [Plivo CLI](https://github.com/plivo/plivo-cli). Install the CLI and log in first, or your agent falls back to raw API calls and loses the checks.
</Info>

```bash theme={null}
npx skills add https://www.plivo.com/docs --skill plivo-audio-streaming
```

That installs into every coding agent it finds. To pick one:

<CodeGroup>
  ```bash Claude Code theme={null}
  npx skills add https://www.plivo.com/docs --skill plivo-audio-streaming --agent claude-code
  ```

  ```bash Cursor theme={null}
  npx skills add https://www.plivo.com/docs --skill plivo-audio-streaming --agent cursor
  ```

  ```bash Codex theme={null}
  npx skills add https://www.plivo.com/docs --skill plivo-audio-streaming --agent codex
  ```
</CodeGroup>

Skills install at project scope by default, which puts them in your repository so teammates and cloud agents get the same setup. Add `--global` to install once for every project.

| Agent       | Where the skill lands                                                 |
| ----------- | --------------------------------------------------------------------- |
| Claude Code | `.claude/skills/` in the project, `~/.claude/skills/` with `--global` |
| Cursor      | `.agents/skills/` in the project, `~/.cursor/skills/` with `--global` |
| Codex       | `.agents/skills/` in the project, `~/.codex/skills/` with `--global`  |

Any tool that follows the [Agent Skills](https://agentskills.io) standard reads the same file.

### Read it before you install

The skill is a plain Markdown file. Open it yourself, or give the URL to your agent.

<Card title="plivo-audio-streaming" icon="file-code" href="https://www.plivo.com/docs/.well-known/agent-skills/plivo-audio-streaming/skill.md">
  The full skill file, published from this documentation site.
</Card>

Every Plivo skill is listed in the [skills index](https://www.plivo.com/docs/.well-known/agent-skills/index.json), with a SHA-256 digest so your agent can verify what it downloaded.

## What is in the skill

| Section                | What it holds                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Readiness gates        | The checks to run before your first call: number, application URLs, XML, WebSocket, and India compliance         |
| Go-live stages         | Prove the bot, create the application, write the XML, first real call, production hosting, human handoff, launch |
| The `<Stream>` element | Every attribute, what the defaults really are, and which combinations do not work together                       |
| WebSocket protocol     | Each message Plivo sends and expects, in both directions, with the audio format rules                            |
| Debugging              | Hangup causes mapped to a cause, an owner and a fix, in the order to check them                                  |
| Human handoff          | Transferring a live call to a person, and what the caller hears while it happens                                 |
| India                  | KYC, number series, media anchoring and consent, for a calling agent                                             |
| Templates              | Known-good XML to copy: stream only, record and stream, greeting first, transfer, and more                       |

## What the agent does with it

1. **Checks readiness before writing code.** The number is rented and voice-enabled, India compliance is accepted, the application has answer, fallback and hangup URLs, the answer URL returns valid `<Stream>` XML, and your WebSocket answers. Read-only: nothing on your account changes.
2. **Writes the XML for your case.** Inbound or outbound, recording, a greeting, human handoff, status callbacks, using shapes that are known to work.
3. **Takes you to the first call in order,** with a check at each step, so a failure is caught where it happens instead of on a live call.
4. **Debugs from evidence.** It runs `plivo voice calls diagnose`, reads the hangup cause, checks the XML, then tests the WebSocket, rather than guessing.

## What it will not do

* It does not cover voice agents built on SIP platforms. Use [the SIP trunking skill](/docs/voice-agents/sip-trunking/integration-guides/ai-coding-agent) for LiveKit, ElevenLabs, Retell or Vapi.
* It does not cover XML beyond a streaming call. For IVRs, call routing, input collection or conferences, use the [Voice XML skill](/docs/voice/xml/ai-coding-agent).
* It does not cover SMS, WhatsApp or the browser SDK.
* It changes nothing on your account while checking. Anything that spends money or changes routing is shown to you first.
* It does not invent CLI flags or XML attributes. Where the documentation does not answer a question, it says so instead of guessing.
* It cannot see what Plivo cannot see, such as whether your server is deployed. It asks you.

## Verify it is working

In the project where you installed it, ask your agent:

> My caller hears silence after the call connects. My answer URL returns a `<Stream>`. What do I check?

You should get an ordered loop that starts with `plivo voice calls diagnose <call_uuid>` and the hangup cause, then the XML, then a WebSocket test. If you get generic WebSocket advice with no Plivo commands, the skill did not load.

## Keeping it current

The published skill tracks this documentation. Your local copy does not update itself:

```bash theme={null}
npx skills update plivo-audio-streaming
```

<Warning>
  An installed skill runs with your agent's permissions. Read the file before installing it, and treat a skill from a source you do not trust the way you would treat a shell script.
</Warning>

## Related

<CardGroup cols={2}>
  <Card title="SIP trunking skill" href="/docs/voice-agents/sip-trunking/integration-guides/ai-coding-agent">
    For agents on LiveKit, ElevenLabs, Retell or Vapi
  </Card>

  <Card title="Voice XML skill" href="/docs/voice/xml/ai-coding-agent">
    For IVRs, call routing, recording and conferences
  </Card>

  <Card title="Audio Streaming overview" href="/docs/voice-agents/audio-streaming/overview">
    How streaming works, without an agent
  </Card>

  <Card title="Plivo CLI" href="https://github.com/plivo/plivo-cli">
    The command-line tool the skill drives
  </Card>
</CardGroup>
