POST /api/tts-hdConvert text to speech using OpenAI TTS-1-HD (higher fidelity). Returns base64-encoded audio. Same interface as /api/tts but with better audio quality. No API key needed; pay per call via x402. Text capped at 2000 chars.
| Field | Type | Description |
|---|---|---|
text * | string | Text to convert to speech (max 2000 chars) |
voice | string | Voice: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer (default: alloy) |
format | string | Audio format: mp3, opus, aac, flac, wav, pcm (default: mp3) |
{
"model": "tts-1-hd",
"provider": "openai",
"voice": "alloy",
"format": "mp3",
"audio": "<base64-encoded audio>",
"chars": 20
}
curl -i -X POST https://agent402.tools/api/tts-hd \
-H "Content-Type: application/json" \
-d '{"text":"Hello from Agent402!","voice":"alloy","format":"mp3"}'
The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/tts-hd", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"text": "Hello from Agent402!",
"voice": "alloy",
"format": "mp3"
}),
});
Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).
POST /api/llmLLM inference proxy — send an OpenAI-format chat/completions request and get a response from GPT-4o-mini. No API key nee…
POST /api/llm-proLLM inference proxy (Pro tier) — GPT-4o or GPT-4.1. Same OpenAI-format interface as /api/llm but with more capable model…
POST /api/llm-premiumLLM inference proxy (Premium tier) — o3-mini reasoning model via the same OpenAI-format interface. No API key needed; pa…