> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CometAPI

> Use the CometAPI speech-to-text plugin in a Zero Runtime pipeline. Setup and usage in Python and JavaScript.

CometAPI is a **speech-to-text** plugin. It runs CometAPI's OpenAI-compatible transcription API, which is handy if you already use CometAPI and want Whisper-style transcription on the same key.

## Setup

Set your CometAPI API key in the worker environment. Generate a key from the [CometAPI site](https://www.cometapi.com/):

```bash theme={null}
export COMETAPI_API_KEY=<key>
```

## Usage

Import the plugin and pass it to the pipeline's `stt` slot.

```python Python theme={null}
from zeroruntime.plugins import CometAPISTT

stt = CometAPISTT()

# Pipeline(stt=stt, ...)
```

```typescript Node JS theme={null}
import { CometAPISTT } from '@zeroruntime/js-sdk/plugins';

const stt = CometAPISTT();

// Pipeline({ stt, ... })
```

## Parameters

*Constructor parameters for `CometAPISTT`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | CometAPI API key. Falls back to the `COMETAPI_API_KEY` environment variable when unset. |
| `model` | `str` | `"whisper-1"` | Transcription model, e.g. "whisper-1". |
| `prompt` | `str \| None` | `None` | Optional text to guide transcription, such as spelling of names or domain terms. |
| `language` | `str` | `"en"` | ISO 639-1 language code of the speech, e.g. "en" or "fr". |

## Import paths

| SDK | Import | Constructor |
| - | - | - |
| Python | `from zeroruntime.plugins import CometAPISTT` | `CometAPISTT()` |
| Node JS | `import { CometAPISTT } from '@zeroruntime/js-sdk/plugins'` | `CometAPISTT()` |

Transcribed text passes to the [LLM](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md) once [turn detection](https://docs.zeroruntime.ai/runtime-sdk/plugins/turn-detection.md) decides the caller has finished speaking.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.