> ## 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, JavaScript, and Go.

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 zrt.plugins import CometAPILLM

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

  # Pipeline(llm=llm, ...)
  ```
</CodeGroup>

## Configuration Options

*Constructor parameters for the Python SDK (`CometAPILLM`). CometAPI is OpenAI-compatible and built on the [OpenAI](/plugins/llm/openai) plugin. The JavaScript and Go SDKs expose the same options in their idiomatic form (camelCase / `LLMOptions` struct).*

| 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 zrt.plugins import CometAPILLM` | `CometAPILLM(...)`                          |
| JavaScript | `from '@zrt/js-sdk/plugins/cometapi'` | `CometAPILLM({ ... })`                      |
| Go         | `.../zrt-golang-sdk/plugins/cometapi` | `cometapi.NewLLM(cometapi.LLMOptions{...})` |

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