Sarvam AI Text to Speech API

The Text to Speech API from Sarvam AI — 1 operation(s) for text to speech.

Operations 1

POST /text-to-speech Convert text to speech #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sarvam-ai-text-to-speech-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sarvam-ai-text-to-speech-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sarvam AI Chat Text to Speech API
  description: REST API for Sarvam AI, India's full-stack sovereign AI platform. Provides chat completions over Sarvam's Indic LLMs, speech-to-text and speech-to-text-translate, text-to-speech, text translation, transliteration, and language identification across Indian languages. All requests authenticate with an api-subscription-key header.
  termsOfService: https://www.sarvam.ai/terms-of-service
  contact:
    name: Sarvam AI Support
    url: https://www.sarvam.ai
  version: '1.0'
servers:
- url: https://api.sarvam.ai
security:
- ApiSubscriptionKey: []
tags:
- name: Text to Speech
paths:
  /text-to-speech:
    post:
      operationId: convertTextToSpeech
      tags:
      - Text to Speech
      summary: Convert text to speech
      description: Synthesizes natural speech for Indian languages using the Bulbul models (v2, v3) with 30+ speakers and configurable pace, pitch, sample rate, and output audio codec. Returns base64-encoded audio.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToSpeechRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextToSpeechResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  responses:
    Unauthorized:
      description: Missing or invalid api-subscription-key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
    TextToSpeechRequest:
      type: object
      required:
      - text
      - target_language_code
      properties:
        text:
          type: string
          description: Max 2500 chars (bulbul:v3) or 1500 chars (bulbul:v2).
        target_language_code:
          type: string
          enum:
          - bn-IN
          - en-IN
          - gu-IN
          - hi-IN
          - kn-IN
          - ml-IN
          - mr-IN
          - od-IN
          - pa-IN
          - ta-IN
          - te-IN
        speaker:
          type: string
          description: Voice name; default shubh (v3) or anushka (v2).
        model:
          type: string
          enum:
          - bulbul:v2
          - bulbul:v3
          default: bulbul:v3
        pitch:
          type: number
          description: -0.75 to 0.75. bulbul:v2 only.
        pace:
          type: number
          default: 1.0
          description: v3 0.5-2.0; v2 0.3-3.0.
        loudness:
          type: number
          description: 0.3 to 3.0. bulbul:v2 only.
        speech_sample_rate:
          type: integer
          default: 24000
          enum:
          - 8000
          - 16000
          - 22050
          - 24000
          - 32000
          - 44100
          - 48000
        enable_preprocessing:
          type: boolean
          default: false
        temperature:
          type: number
          default: 0.6
          description: 0.01 to 2.0. v3 only.
        output_audio_codec:
          type: string
          default: wav
          enum:
          - mp3
          - linear16
          - mulaw
          - alaw
          - opus
          - flac
          - aac
          - wav
    TextToSpeechResponse:
      type: object
      properties:
        request_id:
          type: string
        audios:
          type: array
          items:
            type: string
            description: Base64-encoded audio.
  securitySchemes:
    ApiSubscriptionKey:
      type: apiKey
      in: header
      name: api-subscription-key
      description: API subscription key created in the Sarvam AI dashboard.