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

# CometAPI CLI

> Zainstaluj i używaj interfejsu wiersza poleceń CometAPI, aby rozmawiać z modelami, przeglądać metadane modeli, wykonywać żądania wieloprotokołowe, sprawdzać saldo i analizować użycie z terminala.

The [CometAPI CLI](https://pypi.org/project/cometapi-cli/) is the official command-line tool for CometAPI. It helps you chat with models, inspect the model catalog, send one-off requests, check balance, and browse account usage from the terminal.

Use the [PyPI package page](https://pypi.org/project/cometapi-cli/) as the public homepage for installation and package metadata. This documentation expands on the same commands without requiring access to the private source repository.

<Note>
  The CometAPI CLI is in beta. Command names and options may change while the interface stabilizes.
</Note>

## Features

* Chat with models using streaming output or an interactive REPL
* Browse model catalog metadata, including provider, modality, endpoint, capability, context, and pricing fields
* Inspect one model with `cometapi model info <id>`
* Send one request through Chat Completions, Responses, Anthropic Messages, or Gemini Generate Content formats with `cometapi run`
* Check balance, account profile, usage statistics, API keys, logs, and async task history
* Output table, JSON, YAML, CSV, or Markdown data
* Store local configuration in `~/.config/cometapi/config.toml`

## Prerequisites

* Python 3.10 or later
* A [CometAPI API key](https://www.cometapi.com/console/token)

## Install the CLI

Install the package from PyPI:

<CodeGroup>
  ```bash pip theme={null}
  pip install cometapi-cli
  ```

  ```bash pipx theme={null}
  pipx install cometapi-cli
  ```

  ```bash uv theme={null}
  uv tool install cometapi-cli
  ```
</CodeGroup>

Verify the installed command:

```bash theme={null}
cometapi --version
cometapi -h
```

## Start using the CLI

<Steps>
  <Step title="Configure credentials">
    Run the setup wizard:

    ```bash theme={null}
    cometapi init
    ```

    You can also configure the API key with an environment variable:

    ```bash theme={null}
    export COMETAPI_KEY="your-api-key"
    ```

    The optional `COMETAPI_ACCESS_TOKEN` value is only needed for account, stats, tokens, logs, and tasks commands.
  </Step>

  <Step title="Chat with a model">
    Send one chat message:

    ```bash theme={null}
    cometapi chat "Explain CometAPI in one sentence."
    ```

    Run `cometapi chat` without a message to start the chat REPL.
  </Step>

  <Step title="Browse models">
    Search the public model catalog:

    ```bash theme={null}
    cometapi models --search gpt --limit 10
    ```

    Filter by catalog metadata:

    ```bash theme={null}
    cometapi models --provider openai --type chat --limit 10
    cometapi models --feature image --endpoint responses --json
    ```
  </Step>

  <Step title="Inspect one model">
    Show detail metadata for one model:

    ```bash theme={null}
    cometapi model info your-model-id
    ```

    Output the raw detail payload:

    ```bash theme={null}
    cometapi model info your-model-id --json
    ```
  </Step>

  <Step title="Run a multi-protocol request">
    Send a one-off request through the default chat endpoint:

    ```bash theme={null}
    cometapi run your-model-id -p "Reply with OK only."
    ```

    Select another endpoint format when your request body follows a different provider schema:

    ```bash theme={null}
    cometapi run your-model-id --endpoint responses -p "Reply with OK only." --json
    cometapi run your-model-id --endpoint anthropic -p "Reply with OK only." -i max_tokens=32
    cometapi run your-model-id --endpoint gemini -p "Reply with OK only." -i generationConfig.maxOutputTokens=32
    ```
  </Step>
</Steps>

## Get command help

Use `-h` on the root command or any subcommand to inspect the options for the installed version:

```bash theme={null}
cometapi -h
cometapi models -h
cometapi model info -h
cometapi run -h
```

## Główne polecenia

| Command           | Description                                                           |
| ----------------- | --------------------------------------------------------------------- |
| `chat [MESSAGE]`  | Wyślij wiadomość czatu lub uruchom REPL czatu                         |
| `models`          | Wyświetl i filtruj metadane katalogu modeli                           |
| `model info <id>` | Sprawdź publiczne metadane jednego modelu                             |
| `run [MODEL]`     | Wyślij jedno żądanie w formacie chat, responses, anthropic lub gemini |
| `balance`         | Pokaż saldo konta lub klucza API                                      |
| `account`         | Pokaż profil konta                                                    |
| `stats`           | Pokaż statystyki użycia                                               |
| `tokens`          | Wyświetl i wyszukuj klucze API                                        |
| `logs`            | Przeglądaj logi użycia i eksportuj CSV                                |
| `tasks`           | Przeglądaj logi zadań asynchronicznych                                |
| `init`            | Uruchom kreator konfiguracji                                          |
| `doctor`          | Uruchom diagnostykę konfiguracji                                      |
| `config`          | Zarządzaj lokalną konfiguracją                                        |
| `repl`            | Uruchom interaktywną powłokę poleceń                                  |

## Linki

* [Pakiet PyPI](https://pypi.org/project/cometapi-cli/)
* [Dokumentacja poleceń](/pl/libraries/cli/commands)
* [Przewodnik konfiguracji](/pl/libraries/cli/configuration)
