Skip to content

Step-Audio-TTS-3B

Brief: Convert text to speech using the Step-Audio-TTS-3B model.


Overview

  • Method: POST
  • Path: /v1/audio/speech
  • Content-Type: application/json

Authentication

  • Header: Authorization: Bearer <token>
  • Optional Header: Accept: */*

Request Body Parameters

ParameterTypeRequiredDescription
modelstringYesModel name, set to Step-Audio-TTS-3B
inputstringYesText to convert into speech
extra_bodyobjectNoAdditional settings object for reference text or voice imitation audio
extra_body.prompt_textstringNoReference text used to guide the voice imitation, supports zh or en
extra_body.prompt_audio_urlstringNoVoice imitation audio URL, supports WAV format only

curl Example

bash
curl -X POST "https://api.gpt.ge/v1/audio/speech" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxx" \
  -H "Accept: */*" \
  -d '{
    "model": "Step-Audio-TTS-3B",
    "input": "Hello, I am the morphogen TTS assistant. Thank you for using our API service!",
    "extra_body": {
      "prompt_text": "zh",
      "prompt_audio_url": "https://example.com/path/to/voice.wav"
    }
  }'

JavaScript (fetch) Example

javascript
fetch('https://api.gpt.ge/v1/audio/speech', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk-xxxx',
    'Accept': '*/*'
  },
  body: JSON.stringify({
    model: 'Step-Audio-TTS-3B',
    input: 'Hello, I am the morphogen TTS assistant. Thank you for using our API service!',
    extra_body: {
      prompt_text: 'zh',
      prompt_audio_url: 'https://example.com/path/to/voice.wav'
    }
  })
}).then(r => r.blob()).then(console.log);

Python (requests) Example

python
import requests

response = requests.post(
    'https://api.gpt.ge/v1/audio/speech',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer sk-xxxx',
        'Accept': '*/*'
    },
    json={
        'model': 'Step-Audio-TTS-3B',
        'input': 'Hello, I am the morphogen TTS assistant. Thank you for using our API service!',
        'extra_body': {
            'prompt_text': 'zh',
            'prompt_audio_url': 'https://example.com/path/to/voice.wav'
        }
    }
)
print(response.status_code)
print(response.content[:20])

Response Example (200)

text
<binary audio data returned directly, such as MP3 or WAV file content>

Note: The response usually returns the audio file content directly in the selected audio format.