|
| 1 | +--- |
| 2 | +title: "SexyVoice CLI" |
| 3 | +description: "Install and use the SexyVoice command-line tool for speech generation, voice lookup, curl output, and local playback" |
| 4 | +icon: "terminal" |
| 5 | +--- |
| 6 | + |
| 7 | +The SexyVoice CLI is a command-line client for the SexyVoice speech API. Use it to log in, list voices, generate speech, save or play audio, and print equivalent `curl` requests for debugging. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +- A SexyVoice account |
| 12 | +- API access with enough credits to generate speech |
| 13 | +- One of the installation methods below |
| 14 | + |
| 15 | +## Install |
| 16 | + |
| 17 | +### Shell script |
| 18 | + |
| 19 | +```bash |
| 20 | +curl -fsSL https://raw.githubusercontent.com/gianpaj/sexyvoice-cli/main/install.sh | sh |
| 21 | +``` |
| 22 | + |
| 23 | +To install a specific version, pass the version to the installer: |
| 24 | + |
| 25 | +```bash |
| 26 | +curl -fsSL https://raw.githubusercontent.com/gianpaj/sexyvoice-cli/main/install.sh | sh -s v0.1.0 |
| 27 | +``` |
| 28 | + |
| 29 | +### From source |
| 30 | + |
| 31 | +```bash |
| 32 | +go install github.com/gianpaj/sexyvoice-cli@latest |
| 33 | +``` |
| 34 | + |
| 35 | +### Homebrew |
| 36 | + |
| 37 | +If the Homebrew formula is available, install the CLI from the tap: |
| 38 | + |
| 39 | +```bash |
| 40 | +brew install gianpaj/sexyvoice-cli/sexyvoice-cli |
| 41 | +``` |
| 42 | + |
| 43 | +## Quick start |
| 44 | + |
| 45 | +```bash |
| 46 | +# Open the dashboard login flow and save an API key locally |
| 47 | +sexyvoice login |
| 48 | + |
| 49 | +# Generate speech and play it immediately |
| 50 | +sexyvoice tts "Hello from SexyVoice" --voice achernar --model-id gpro |
| 51 | + |
| 52 | +# Save generated speech to a file |
| 53 | +sexyvoice tts "Hello from SexyVoice" --voice achernar --model-id gpro -o hello.wav |
| 54 | + |
| 55 | +# List available voices |
| 56 | +sexyvoice voices |
| 57 | + |
| 58 | +# Print the equivalent curl request |
| 59 | +sexyvoice curl "Hello from SexyVoice" --voice achernar --model-id gpro --format wav |
| 60 | +``` |
| 61 | + |
| 62 | +## Commands |
| 63 | + |
| 64 | +### `sexyvoice login` |
| 65 | + |
| 66 | +Open the SexyVoice dashboard in your browser and save an API key locally. The login flow can reuse an existing API key by rotating it and storing the replacement key on your machine. |
| 67 | + |
| 68 | +### `sexyvoice tts TEXT` |
| 69 | + |
| 70 | +Generate speech audio from text. |
| 71 | + |
| 72 | +Common flags: |
| 73 | + |
| 74 | +| Flag | Short | Description | |
| 75 | +| ------------ | ----- | -------------------------------------- | |
| 76 | +| `--voice` | `-v` | Voice name to use | |
| 77 | +| `--model-id` | `-m` | Model ID: `gpro`, `grok`, or `orpheus` | |
| 78 | +| `--format` | `-f` | Response format: `wav` or `mp3` | |
| 79 | +| `--style` | | Optional style prompt | |
| 80 | +| `--seed` | | Optional deterministic seed | |
| 81 | +| `--output` | `-o` | Save to a file, or use `-` for stdout | |
| 82 | +| `--play` | `-p` | Play audio locally | |
| 83 | +| `--json` | | Emit CLI result metadata as JSON | |
| 84 | + |
| 85 | +### `sexyvoice voices` |
| 86 | + |
| 87 | +List voices available from `GET /api/v1/voices`. The output includes voice names, model IDs, languages, formats, style support, and voice IDs. |
| 88 | + |
| 89 | +```bash |
| 90 | +sexyvoice voices |
| 91 | +``` |
| 92 | + |
| 93 | +Use `--json` when you need machine-readable output: |
| 94 | + |
| 95 | +```bash |
| 96 | +sexyvoice voices --json |
| 97 | +``` |
| 98 | + |
| 99 | +### `sexyvoice curl TEXT` |
| 100 | + |
| 101 | +Print the equivalent `curl` request for the speech endpoint. Use this when you want to debug a request or move from the CLI to a backend integration. |
| 102 | + |
| 103 | +```bash |
| 104 | +sexyvoice curl "Hello from SexyVoice" --voice achernar --model-id gpro --format wav |
| 105 | +``` |
| 106 | + |
| 107 | +### `sexyvoice key` |
| 108 | + |
| 109 | +Print the resolved API key with no trailing newline. |
| 110 | + |
| 111 | +```bash |
| 112 | +sexyvoice key |
| 113 | +``` |
| 114 | + |
| 115 | +<Callout type="warn"> |
| 116 | + Only run `sexyvoice key` in a private terminal. Do not paste API keys into logs, tickets, |
| 117 | + screenshots, or client-side code. |
| 118 | +</Callout> |
| 119 | + |
| 120 | +### `sexyvoice config` |
| 121 | + |
| 122 | +Manage config environments in `~/.sexyvoice/sexyvoice.toml`. |
| 123 | + |
| 124 | +```bash |
| 125 | +sexyvoice config |
| 126 | +``` |
| 127 | + |
| 128 | +### `sexyvoice play FILE` |
| 129 | + |
| 130 | +Play a local WAV or MP3 file. |
| 131 | + |
| 132 | +```bash |
| 133 | +sexyvoice play hello.wav |
| 134 | +``` |
| 135 | + |
| 136 | +### `sexyvoice logout` |
| 137 | + |
| 138 | +Remove the saved local API key. |
| 139 | + |
| 140 | +```bash |
| 141 | +sexyvoice logout |
| 142 | +``` |
| 143 | + |
| 144 | +## Configuration |
| 145 | + |
| 146 | +| Item | Location | |
| 147 | +| ------------------------ | ------------------------------ | |
| 148 | +| Config directory | `~/.sexyvoice/` | |
| 149 | +| Config file | `~/.sexyvoice/sexyvoice.toml` | |
| 150 | +| Env API key override | `SEXYVOICE_API_KEY` | |
| 151 | +| Env API URL override | `SEXYVOICE_API_URL` | |
| 152 | +| Env auth prefix override | `SEXYVOICE_AUTH_HEADER_PREFIX` | |
| 153 | + |
| 154 | +Default API URL: |
| 155 | + |
| 156 | +```text |
| 157 | +https://sexyvoice.ai/api/v1/speech |
| 158 | +``` |
| 159 | + |
| 160 | +## How it works |
| 161 | + |
| 162 | +- `sexyvoice login` opens a browser-based dashboard flow and stores an API key locally. |
| 163 | +- The CLI validates API keys against `GET /api/v1/models`. |
| 164 | +- `sexyvoice tts` calls `POST /api/v1/speech` and downloads the returned audio URL for playback or saving. |
| 165 | +- `sexyvoice curl` prints the request you can adapt for scripts, servers, and tests. |
| 166 | + |
| 167 | +## Next steps |
| 168 | + |
| 169 | +- Read the [API Quickstart](./api) to integrate speech generation into your app. |
| 170 | +- Browse the [API Reference](../api-reference/api) for endpoint details. |
| 171 | +- Use the [Grok Voices & Speech Tags](./grok-speech-tags) guide for expressive Grok speech. |
0 commit comments