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

# Installation

> Install the Kardinal Python or TypeScript SDK and its optional kardinal command-line tool, check the supported runtimes, and verify that the setup works.

## Requirements

<Tabs>
  <Tab title="Python">
    Python 3.10 or later. The package depends on `pydantic` and `httpx` only; the command-line tool adds `Typer`.
  </Tab>

  <Tab title="TypeScript">
    Node.js 22 or later. The package depends on `zod` only; the command-line tool adds `commander`.
  </Tab>
</Tabs>

## Installing the package

<CodeGroup>
  ```bash Python theme={null}
  pip install kardinal-ai
  ```

  ```bash TypeScript theme={null}
  npm install @kardinal-ai/sdk
  ```
</CodeGroup>

The Python package is published as `kardinal-ai` but imports as `kardinal`: `from kardinal import Kardinal`.

## Installing the command-line tool

The [`kardinal` command](/sdks/cli) ships with both packages, behind an optional dependency.

<CodeGroup>
  ```bash Python theme={null}
  pip install "kardinal-ai[cli]"   # in your project's environment
  pipx install "kardinal-ai[cli]"  # or as a standalone command
  ```

  ```bash TypeScript theme={null}
  npm install @kardinal-ai/sdk commander   # in your project
  npm install -g @kardinal-ai/sdk commander  # or as a global command
  ```
</CodeGroup>

Both commands are the same tool, with the same subcommands and output: install whichever matches the runtime you already have. A developer working in TypeScript can also use the Python one, and the reverse.

## Supported runtimes

<Tabs>
  <Tab title="Python">
    The client is synchronous: every method returns once its HTTP call is done. The package ships its type hints (`py.typed`), so a type checker such as mypy or Pyright, and your editor, see the types of every model and method.
  </Tab>

  <Tab title="TypeScript">
    The package is an ES module, with its type declarations included: load it with `import`. Every method returns a `Promise`, except `plans.iterAll`, an async iterator. Requests go through the `fetch` built into Node.js.

    <Warning>
      **The TypeScript SDK targets Node.js only, not browsers.** An API key gives full access to its agency's plans and is valid for a year: it must stay on a server. Never ship it in a front-end bundle, which includes any environment variable a framework exposes to the browser, such as those prefixed with `NEXT_PUBLIC_`, `VITE_`, or `PUBLIC_`. See [Keeping the key server-side](/sdks/configuration#keeping-the-key-server-side).
    </Warning>
  </Tab>
</Tabs>

## Verifying the installation

With `KARDINAL_API_KEY` set (see [Client configuration](/sdks/configuration)), the command-line tool checks the key against the API without creating anything:

```bash theme={null}
kardinal auth check
```

It confirms the key works, and shows the host and the agency it belongs to. Without the command-line tool, run the [quickstart](/sdks/quickstart) instead: with a sandbox key, it consumes no credits.


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