---
title: "POST /api/v1/client/txt2audio/price-calculation"
method: POST
path: "/api/v1/client/txt2audio/price-calculation"
tags: ["Client API"]
---

# POST /api/v1/client/txt2audio/price-calculation

`POST /api/v1/client/txt2audio/price-calculation`

Endpoint for calculating price for text2audio inference. Either text or count_text must be provided.

## Headers

- `Accept` 'application/json', required

## Request body

- object
  - `text` string, nullable — Text to be converted to speech. Either this or count_text must be provided.
  - `count_text` integer, nullable — Number of characters for price calculation. Either this or text must be provided.
  - `model` string, required — The model to use for speech generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.
  - `mode` 'custom_voice' | 'voice_clone' | 'voice_design', nullable — TTS mode: custom_voice (default), voice_clone, or voice_design.
  - `voice` string, nullable — Name of the voice to be used. Only relevant for custom_voice mode.
  - `lang` string, required — Language to be used during audio generation
  - `speed` number, required — Generated audio speech speed
  - `format` string, required — Audio output format
  - `sample_rate` number, required — Sample rate of generated audio
  - `instruct` string, nullable — Natural language voice description for voice_design mode price calculation.

## Response `200`

Calculated price for text2audio inference.

- object
  - `data` object
    - `price` number, float — Calculated price for the inference

## Other responses

- `401` — Unauthorized user.
- `404` — Not found.
- `422` — Validation failed. Common errors include: model does not exist, model does not support the inference type for this endpoint, or invalid request parameters.
- `429` — Rate limit exceeded. Check X-RateLimit-Type header to determine if minute (RPM) or daily (RPD) limit was hit.

---

[API](https://skmtc.net/deapi/apis/deapi-rest-api.md) · [All operations](https://skmtc.net/deapi/apis/deapi-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deapi/deapi-rest-api/versions/c70b8b231ca8/schema)
