Skip to content
allitBeta
  • Models
  • UBIA
  • Chat
  • Hub
  • Studio
  • Pricing
  • API
  • Privacy
    • $ALL
    • WIT
    • Auction
    • Staking
Connect walletTry free
allitBeta
  • Models
  • UBIA
  • Chat
  • Hub
  • Studio
  • Pricing
  • API
  • Privacy

Token

  • $ALL
  • WIT
  • Auction
  • Staking
Try freeConnect wallet
Docs / Speech
  • Getting started

    • Allwit docs
    • Wallet sign-in
  • $ALL token

    • $ALL token
    • Launch auction
    • Staking
    • Buyback and burn
  • WIT credits

    • WIT credits
    • The daily allowance
    • Buy WIT credits
    • Pricing and spending
  • Platform

    • Privacy and labels
    • Models
    • Hub
    • Agent Studio
  • API

    • Developer API
    • Authentication
    • Models and pricing
    • Chat completions
    • Images
    • Transcriptions
    • Speech
    • Videos
    • Errors
    • Rate limits
  • Reference

    • Parameters
    • Risks and disclaimer
  • Community

    • X
Docs
  • Getting started

    • Allwit docs
    • Wallet sign-in
  • $ALL token

    • $ALL token
    • Launch auction
    • Staking
    • Buyback and burn
  • WIT credits

    • WIT credits
    • The daily allowance
    • Buy WIT credits
    • Pricing and spending
  • Platform

    • Privacy and labels
    • Models
    • Hub
    • Agent Studio
  • API

    • Developer API
    • Authentication
    • Models and pricing
    • Chat completions
    • Images
    • Transcriptions
    • Speech
    • Videos
    • Errors
    • Rate limits
  • Reference

    • Parameters
    • Risks and disclaimer
  • Community

    • X

API

Speech

POST /audio/speech: text to speech, returned as audio bytes.

Request

`POST /audio/speech` takes `model` (a speech model id from `/models`), `input` (up to 4,096 characters), optional `voice` (a voice name or id the provider knows; omitted, the model's `default_voice` from `/models` speaks), `speed` and `response_format` (`mp3`, the default; each model lists the formats it takes on `/models`, out of `opus`, `aac`, `flac`, `wav` and `pcm`). The response body is the audio; the WIT charged, the model's `per_1k_chars` price times the started blocks of 1,000 characters, is in the `x-allwit-wit-charged` header. The input text is never stored.

Pythonpython
from openai import OpenAI

client = OpenAI(
    base_url="https://www.allwit.ai/api/v1",
    api_key="aw_live_…",  # from /app/account/api-keys
)

speech = client.audio.speech.create(
    model="<a speech model id from GET /models>",
    voice="alloy",
    input="Welcome to Allwit. Every model, one wallet.",
    response_format="mp3",
)
speech.write_to_file("welcome.mp3")
JavaScriptjavascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://www.allwit.ai/api/v1",
  apiKey: process.env.ALLWIT_API_KEY, // aw_live_…
});

const speech = await client.audio.speech.create({
  model: "<a speech model id from GET /models>",
  voice: "alloy",
  input: "Welcome to Allwit. Every model, one wallet.",
  response_format: "mp3",
});
await fs.promises.writeFile("welcome.mp3", Buffer.from(await speech.arrayBuffer()));
curlbash
curl https://www.allwit.ai/api/v1/audio/speech \
  -H "Authorization: Bearer $ALLWIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "<speech model id>", "input": "Welcome to Allwit.", "response_format": "mp3"}' \
  --output welcome.mp3
PreviousTranscriptionsNext Videos

On this page

  1. Request
allit

Intelligence, open to everyone. One gateway to every AI model.

  • Allwit on X

© 2026 Allwit

Product

  • Models
  • Chat
  • Hub
  • Agent Studio
  • Pricing
  • UBIA

Developers

  • API
  • Docs
  • Whitepaper

Token

  • $ALL
  • WIT
  • Auction
  • Staking

Legal

  • Privacy
  • Terms
  • Cookies
  • Cookie settings

    Allwit uses no advertising or analytics cookies. Here is what it keeps in this browser.

    Strictly necessary

    The sign-in cookie and your chat history. Needed for Allwit to work.

    Always on

    Remember your light or dark theme on this device.

    Analytics and advertising cookies

    None. Page views are counted without cookies by analytics Allwit hosts itself, which stores nothing in your browser and never sees your wallet address. No advertising.

    No cookies

    Chat history

    Conversations saved in this browser. Deleting them here does not touch any encrypted copies you chose to sync. Manage encrypted history sync

    Read the cookie policy