> ## 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 LLM plugin in a Zero Runtime pipeline to access many models through one endpoint. Setup, options, and usage in Python and JavaScript.

CometAPI is an **LLM** plugin. It exposes many models behind a single OpenAI-compatible
endpoint, so you can switch models without changing providers. It takes the transcribed
conversation and generates the reply.

## Setup

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

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

## Usage

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

<CodeGroup>
  ```python Python theme={null}
  from zeroruntime.plugins import CometAPILLM

  llm = CometAPILLM(
      model="gpt-4o-mini",
      temperature=0.7,
  )

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

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

  const llm = CometAPILLM({
    model: 'gpt-4o-mini',
    temperature: 0.7,
  });

  // Pipeline({ llm, ... })
  ```
</CodeGroup>

## Configuration Options

*Constructor parameters for `CometAPILLM`. The Python and Node JS SDKs share these field names. CometAPI is OpenAI-compatible and built on the [OpenAI](/plugins/llm/openai) plugin.*

| Parameter               | Type    | Default         | Description                                                                         |
| ----------------------- | ------- | --------------- | ----------------------------------------------------------------------------------- |
| `api_key`               | `str`   | `None`          | CometAPI key. Falls back to the `COMETAPI_API_KEY` environment variable when unset. |
| `model`                 | `str`   | `"gpt-4o-mini"` | Model used to generate replies.                                                     |
| `temperature`           | `float` | `0.7`           | Sampling randomness; lower is more deterministic.                                   |
| `max_completion_tokens` | `int`   | `None`          | Caps the length of each reply.                                                      |

## Import paths

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

The reply is streamed to the [text-to-speech](/plugins/tts/cartesia) plugin, which
synthesizes the agent's voice.
