# Kotoba Speech-to-Speech

> Translate Japanese and English speech in real time, with translated text and synthesized audio.


## Overview

- **Endpoint**: `https://fal.run/kotoba-technologies/kotoba-sts/v1/speech-to-speech`
- **Model ID**: `kotoba-technologies/kotoba-sts/v1/speech-to-speech`
- **Category**: speech-to-speech
- **Kind**: inference
**Description**: ## Kotoba Speech-to-Speech

Translate speech and receive both translated text and synthesized speech. The Playground demo supports Japanese-to-English and English-to-Japanese. Production streaming uses a WebSocket connection; each session translates in one direction. Suitable for cross-language meetings, customer support, live interpretation, and voice agents.

### Playground demo
The Playground provides a one-shot demonstration, not a streaming interface. Supply an audio URL and select Japanese-to-English or English-to-Japanese translation. The response includes translated text and a WAV audio file. The audio is shown in the preview; view the JSON response for the translated text. Maximum demo input: 5 minutes.

### Streaming API
Use the Kotoba Python SDK or a WebSocket client at `wss://fal.run/Kotoba-Technologies/kotoba-sts/v1/realtime_voice`. Send base64 audio in JSON events. Input supports 16-bit PCM or float32 with a configurable sample rate; 24 kHz mono is recommended. Output includes text deltas and translated audio as 16-bit PCM at 24 kHz.

### Streaming language support
Stable translation pairs: Japanese ↔ English, Japanese ↔ Korean, English ↔ Korean, and English ↔ Mandarin. Japanese ↔ Mandarin and Korean ↔ Mandarin are beta.

### Pricing
$0.035 per minute of input audio. Billing is based on input audio seconds, not generated speech duration.

**Tags**: commercial-use, speech-to-speech, translation, japanese, english, realtime



## Pricing

Kotoba STS: $0.035 per minute of input audio; billed per input audio second.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`audio_url`** (`string`, _required_):
  Speech to translate: an https:// URL on fal's CDN (Playground uploads and microphone recordings) or a base64 data: URI. Up to 5 minutes.

- **`source_language`** (`SourceLanguageEnum`, _required_):
  Language spoken in the audio.
  - Options: `"ja"`, `"en"`, `"ko"`, `"zh"`

- **`target_language`** (`TargetLanguageEnum`, _required_):
  Language to translate into; not the source language.
  - Options: `"en"`, `"ja"`, `"ko"`, `"zh"`



**Required Parameters Example**:

```json
{
  "audio_url": "",
  "source_language": "ja",
  "target_language": "en"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`MediaFile`, _required_):
  Translated speech (WAV, 24 kHz mono, 16-bit) as a link to the file: from the first word to the last, without the silence the model leaves before and after. Null when nothing was spoken.

- **`output_audio_duration_secs`** (`float`, _required_):
  Seconds of translated speech returned.

- **`source_language`** (`string`, _required_):
  Language of the input audio.

- **`text`** (`string`, _required_):
  Translated text.

- **`target_language`** (`string`, _required_):
  Language of the translation.

- **`audio_duration_secs`** (`float`, _required_):
  Seconds of decoded input audio (the billed units).



**Example Response**:

```json
{
  "audio": {
    "content_type": "",
    "file_name": "",
    "url": ""
  },
  "source_language": "",
  "text": "",
  "target_language": ""
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/kotoba-technologies/kotoba-sts/v1/speech-to-speech \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "",
     "source_language": "ja",
     "target_language": "en"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "kotoba-technologies/kotoba-sts/v1/speech-to-speech",
    arguments={
        "audio_url": "",
        "source_language": "ja",
        "target_language": "en"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("kotoba-technologies/kotoba-sts/v1/speech-to-speech", {
  input: {
    audio_url: "",
    source_language: "ja",
    target_language: "en"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/kotoba-technologies/kotoba-sts/v1/speech-to-speech)
- [API Documentation](https://fal.ai/models/kotoba-technologies/kotoba-sts/v1/speech-to-speech/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=kotoba-technologies/kotoba-sts/v1/speech-to-speech)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
