# fastapi.online Voice Clone (Speech Synthesis from Reference Audio)

> fastapi.online Voice Clone (Speech Synthesis from Reference Audio) is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.05/call, status down (last checked 2026-09-15).

Clones a speaker's voice from a short reference audio clip and synthesizes new speech from provided text, returning a WAV audio file.

## Facts

- Endpoint: POST https://api.fastapi.online/voice-clone
- Price: $0.05/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-voice-clone-speech-synthesis-from-reference-audio-4761fe88
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mVeXD9hx8PKf45-5-8RUu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability fastapi-online-voice-clone-speech-synthesis-from-reference-audio-4761fe88 -d '<json body>'
```

Example prompt: Using my short voice recording (I'll provide it as base64 WAV), clone my voice and generate audio of it saying: 'Welcome to our service, we're glad you're here.' — the transcript of my reference clip is 'Hi there, this is my voice sample.'

## When to prefer this

Choose this endpoint when you need to synthesize speech that mimics a specific person's voice given only a short reference recording — ideal for personalized audio generation, voice preservation, or custom narration. Prefer this over generic TTS endpoints when voice identity matters and you have a reference sample. Best for single-call, pay-per-use scenarios with no signup overhead.

## Known failure modes

- Reference audio too short or low quality — cloning fails or produces distorted output
- Base64 encoding of audio is malformed — returns a 400 or processing error
- Text input exceeds 5000 characters — rejected by schema validation
- Reference transcript does not match the reference audio — reduced cloning accuracy
- Audio format unsupported (non-WAV/MP3) — processing error
- Payment of $0.05 USDC not completed — 402 Payment Required response

## How this service works

Self-hosted AI API gateway. Expensive endpoints require an x402 micropayment (USDC on Base) before executing.

## Output

A JSON object containing an 'audio_base64' field with the base64-encoded WAV audio of the synthesized speech in the cloned voice, and a 'format' field confirming the output is WAV.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "reference_audio_base64",
      "reference_text",
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 5000,
       "minLength": 1,
       "description": "Text to speak in the cloned voice."
      },
      "reference_text": {
       "type": "string",
       "maxLength": 1000,
       "minLength": 1,
       "description": "Transcript of the reference audio."
      },
      "reference_audio_base64": {
       "type": "string",
       "minLength": 16,
       "description": "Base64 WAV/MP3 of the voice to clone (a few seconds)."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "format": "wav",
  "audio_base64": "<wav>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-voice-clone-speech-synthesis-from-reference-audio-4761fe88/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
