Files
sdk/docs/SpeechApi.md
zeekayandHanzo Dev b55332704a feat: Hanzo Cloud SDK for Kotlin (generated from OpenAPI v8.0.0)
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and
Android. Generated with openapi-generator kotlin (library=jvm-okhttp4,
useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-25 07:10:32 -07:00

6.7 KiB

SpeechApi

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
chatGetFilesSpeechConfigGet GET /v1/chat/files/speech/config/get Get custom speech configuration
chatGetFilesSpeechTtsVoices GET /v1/chat/files/speech/tts/voices Get available TTS voices
chatPostFilesSpeechStt POST /v1/chat/files/speech/stt Speech to text
chatPostFilesSpeechTts POST /v1/chat/files/speech/tts Stream text to speech
chatPostFilesSpeechTtsManual POST /v1/chat/files/speech/tts/manual Manual text to speech

chatGetFilesSpeechConfigGet

kotlin.Any chatGetFilesSpeechConfigGet()

Get custom speech configuration

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = SpeechApi()
try {
    val result : kotlin.Any = apiInstance.chatGetFilesSpeechConfigGet()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling SpeechApi#chatGetFilesSpeechConfigGet")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling SpeechApi#chatGetFilesSpeechConfigGet")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

kotlin.Any

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

chatGetFilesSpeechTtsVoices

kotlin.Any chatGetFilesSpeechTtsVoices()

Get available TTS voices

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = SpeechApi()
try {
    val result : kotlin.Any = apiInstance.chatGetFilesSpeechTtsVoices()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling SpeechApi#chatGetFilesSpeechTtsVoices")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling SpeechApi#chatGetFilesSpeechTtsVoices")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

kotlin.Any

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

chatPostFilesSpeechStt

kotlin.Any chatPostFilesSpeechStt(audio)

Speech to text

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = SpeechApi()
val audio : java.io.File = BINARY_DATA_HERE // java.io.File | 
try {
    val result : kotlin.Any = apiInstance.chatPostFilesSpeechStt(audio)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling SpeechApi#chatPostFilesSpeechStt")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling SpeechApi#chatPostFilesSpeechStt")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
audio java.io.File

Return type

kotlin.Any

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

chatPostFilesSpeechTts

java.io.File chatPostFilesSpeechTts(chatPostFilesSpeechTtsRequest)

Stream text to speech

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = SpeechApi()
val chatPostFilesSpeechTtsRequest : ChatPostFilesSpeechTtsRequest =  // ChatPostFilesSpeechTtsRequest | 
try {
    val result : java.io.File = apiInstance.chatPostFilesSpeechTts(chatPostFilesSpeechTtsRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling SpeechApi#chatPostFilesSpeechTts")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling SpeechApi#chatPostFilesSpeechTts")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
chatPostFilesSpeechTtsRequest ChatPostFilesSpeechTtsRequest

Return type

java.io.File

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

chatPostFilesSpeechTtsManual

kotlin.Any chatPostFilesSpeechTtsManual(text, voice)

Manual text to speech

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = SpeechApi()
val text : kotlin.String = text_example // kotlin.String | 
val voice : kotlin.String = voice_example // kotlin.String | 
try {
    val result : kotlin.Any = apiInstance.chatPostFilesSpeechTtsManual(text, voice)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling SpeechApi#chatPostFilesSpeechTtsManual")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling SpeechApi#chatPostFilesSpeechTtsManual")
    e.printStackTrace()
}

Parameters

| text | kotlin.String| | [optional] |

Name Type Description Notes
voice kotlin.String [optional]

Return type

kotlin.Any

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json