Skip to Content

Multimodal API

This document describes how to use the account-level Multimodal API, which provides various multimodal interface services. Currently, the following service is available:

Text-to-Speech (TTS)

Converts the provided text into a speech audio file.

API Description

POST https://api.ticos.ai/v1/multimodal/tts

Authentication

This endpoint requires Bearer Token authentication. Include your API key or terminal secret in the Authorization header.

Request Headers

ParameterRequiredDescription
Content-TypeYesFixed value: application/json
AuthorizationYesFormat: Bearer <your_token>, where token is your API key or terminal secret

Request Body

The request body is in JSON format and contains the following fields:

{ "text": "Hello, world!", "voice": "en-US-Wavenet-D", "speed_ratio": 50, "pitch_ratio": 50, "volume_ratio": 50 }

Request Body Fields

FieldTypeRequiredDefaultDescription
textstringYesThe text to be converted to speech.
voicestringNonullThe voice model to use.
speed_ratiointegerNo50The speed ratio of the speech (1-100).
pitch_ratiointegerNo50The pitch ratio of the speech (1-100).
volume_ratiointegerNo50The volume ratio of the speech (1-100).

Response

Success Response

  • Status Code: 200 OK
  • Headers: Content-Type: audio/wav
  • Body: The binary WAV audio data.

Error Responses

  • 400 Bad Request: Invalid request body (e.g., missing text field).
  • 401 Unauthorized: Authentication failed (e.g., invalid token).
  • 500 Internal Server Error: Internal server error (e.g., TTS service is not configured or unreachable).

Example Code

cURL

curl -X 'POST' \ 'https://api.ticos.ai/v1/multimodal/tts' \ -H 'Authorization: Bearer ts_your_api_key_1234567890' \ -H 'Content-Type: application/json' \ -d '{ "text": "This is a test of the TTS service.", "voice": "zhifeng_emo" }' \ --output test_audio.wav

Available Voices

Retrieve a list of available voice models for the TTS service.

API Description

GET https://stardust.ticos.cn/tts

Query Parameters

ParameterRequiredDefaultDescription
languageNo-Filter voices by language (e.g., chinese, english)
skipNo0Pagination start position
topNo10Number of voices to return