> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ishushka.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ishushka.com/_mcp/server.

# Text to speech (POST)

POST https://api.ishushka.com/speech/text-to-speech/{conversation}/
Content-Type: multipart/form-data



Reference: https://docs.ishushka.com/ishushka-api-actual/speech/text-to-speech-post

## Request

### Path parameters

- `conversation` (string, required)

### Query parameters

- `apikey` (string, required) — API key

### Body (multipart/form-data)

- `message` (string, optional) — Prompt/message
- `version` (string, optional) — Model ID from /info
- `conversation_id` (string, optional)
- `ref` (string, optional) — Optional referral code
- `aspectRatio` (string, optional) — Image aspect ratio

## Response

### 200

Success

- `status` (integer, optional)
- `message` (string, optional) — Assistant response text
- `balance` (double, optional) — Remaining balance
- `data` (object, optional)
  - `tokens_in` (integer, optional)
  - `tokens_out` (integer, optional)

## Examples

**Request**

```json
{
  "aspectRatio": {
    "type": "json"
  },
  "conversation_id": {
    "type": "json"
  },
  "message": {
    "type": "json"
  },
  "ref": {
    "type": "json"
  },
  "version": {
    "type": "json"
  }
}
```

**Response**

```json
{
  "status": 200,
  "message": "string",
  "balance": 1.1,
  "data": {
    "tokens_in": 1,
    "tokens_out": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.ishushka.com/speech/text-to-speech/conversation/"

querystring = {"apikey":"apikey"}

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspectRatio\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversation_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"ref\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n"
headers = {"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"}

response = requests.post(url, data=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey';
const form = new FormData();
form.append('aspectRatio', '{
  "type": "json"
}');
form.append('conversation_id', '{
  "type": "json"
}');
form.append('message', '{
  "type": "json"
}');
form.append('ref', '{
  "type": "json"
}');
form.append('version', '{
  "type": "json"
}');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspectRatio\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversation_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"ref\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspectRatio\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversation_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"ref\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspectRatio\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversation_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"ref\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey', [
  'multipart' => [
    [
        'name' => 'aspectRatio',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'conversation_id',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'message',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'ref',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'version',
        'contents' => '{
  "type": "json"
}'
    ]
  ]
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"aspectRatio\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"conversation_id\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"message\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"ref\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation
let parameters = [
  [
    "name": "aspectRatio",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "conversation_id",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "message",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "ref",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "version",
    "value": "{
  \"type\": \"json\"
}"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ishushka.com/speech/text-to-speech/conversation/?apikey=apikey")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```