> ## 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>
  Skills ship inside the [Plivo CLI](https://github.com/plivo/plivo-cli), so install it first:

  ```bash theme={null}
  brew install plivo/tap/plivo
  plivo login
  ```

  The skill also drives Plivo through the CLI, so without it your agent falls back to raw API calls and loses the checks.
</Info>

```bash theme={null}
plivo skill install audio-streaming
```

The skill ships inside the CLI binary, so this writes it out with no network call and no other tooling.

It lands in Claude Code's skills directory by default. For another agent, name the directory:

<CodeGroup>
  ```bash Claude Code theme={null}
  plivo skill install audio-streaming
  ```

  ```bash Cursor theme={null}
  plivo skill install audio-streaming --dir ~/.cursor/skills/plivo-audio-streaming
  ```

  ```bash Codex theme={null}
  plivo skill install audio-streaming --dir ~/.codex/skills/plivo-audio-streaming
  ```
</CodeGroup>

To see every skill in your binary and whether it is installed:

```bash theme={null}
plivo skill list
```

```
SELECTOR          INSTALLS TO             STATE          WHAT IT IS
cli               plivo-cli               installed      the CLI reference
audio-streaming   plivo-audio-streaming   not installed  connect a WebSocket voice bot to calls with <Stream>
sip-trunking      plivo-sip-trunking      not installed  connect an AI voice platform over SIP trunking
voice-xml         plivo-voice-xml         installed      write and fix Plivo Voice XML
```

`plivo skill install all` writes every one of them.

### Read it before you install

The skill is a plain Markdown file. Print it and read it before it goes anywhere near your agent:

```bash theme={null}
plivo skill install audio-streaming --print | less
```

`--dry-run` shows where a file would be written without writing it.

## 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 skill ships with the CLI, so it moves when the CLI does. Upgrade the binary, then reinstall:

```bash theme={null}
plivo upgrade
plivo skill install audio-streaming
```

`plivo skill list` marks a skill `installed (differs from bundled)` when your copy no longer matches the one in the binary, which is how you spot a stale or locally edited skill.

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