# aimlapi

> Connect any coding agent to AI/ML API with one command

Latest version **0.2.0** (published 2026-09-24) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install aimlapi
pnpm add aimlapi
yarn add aimlapi
bun add aimlapi
```

Provides the command `aimlapi`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-09-24 |
| First published | 2026-09-24 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 34.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aiml_api |
| Keywords | aimlapi, cli, claude-code, codex, opencode, cline, openclaude, openclaw, zero, zcode, hermes, glm |

## Links

- npm: https://www.npmjs.com/package/aimlapi
- Homepage: https://aimlapi.com
- npm.io page: https://npm.io/package/aimlapi

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2026-09-24

## README

# aimlapi

Connect your coding agent to [AI/ML API](https://aimlapi.com) with one command.

```sh
npx aimlapi claude
```

The first run signs you in through the browser (or a device code over SSH),
creates an API key, points the agent at AI/ML API and starts it. Add
`--dry-run` to see what would change without touching anything, and `--undo`
to revert it.

## Let your agent set it up

Tell your coding agent (Claude Code, Codex, OpenCode, Cline, OpenClaude, OpenClaw, Hermes Agent, zero or ZCode):

```text
Read https://docs.aimlapi.com/quickstart/cli/aimlapi-setup.md and follow it to connect this agent to AI/ML API.
```

It signs you in through the browser (you approve; you never paste a key into
the chat), shows what it will change with `--dry-run`, applies it after you
confirm, and tells you how to undo it.

In Claude Code you can also install it as a skill and then just ask it to
"set up AI/ML API":

```sh
mkdir -p ~/.claude/skills/aimlapi-setup
curl -fsSL https://raw.githubusercontent.com/aimlapi/api-docs/main/skills/aimlapi-setup/SKILL.md \
  -o ~/.claude/skills/aimlapi-setup/SKILL.md
```

## Supported agents

| Agent | Command |
| ----- | ------- |
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `npx aimlapi claude` |
| [Codex](https://github.com/openai/codex) | `npx aimlapi codex` |
| [OpenCode](https://opencode.ai) | `npx aimlapi opencode` |
| [Cline](https://cline.bot) | `npx aimlapi cline` |
| [OpenClaude](https://github.com/Gitlawb/openclaude) | `npx aimlapi openclaude` |
| [OpenClaw](https://github.com/openclaw/openclaw) | `npx aimlapi openclaw` |
| [zero](https://github.com/Gitlawb/zero) | `npx aimlapi zero` |
| [ZCode](https://zcode.z.ai) (Z.ai, GLM models) | `npx aimlapi zcode` |
| [Hermes Agent](https://hermes-agent.nousresearch.com) | `npx aimlapi hermes` |

The agent itself must already be installed; if it is not, `aimlapi` prints the
install command and exits.

OpenClaw has no per-run provider switch: `aimlapi openclaw` writes the
AI/ML API provider and default model into its `openclaw.json` (a running
Gateway reloads it) and then starts `openclaw`. That config points at
aimlapi's credentials file instead of holding the key, so sign in with
`aimlapi login` (setting `AIMLAPI_API_KEY` alone is not enough) and run
`openclaw secrets reload` after signing in with a new key.
ZCode's terminal agent (`zcode`) has no published package yet: build it from
[its repository](https://github.com/zai-org/ZCode/blob/main/README.en.md#zcode-cli-distribution).
`aimlapi zcode --config` also sets up the ZCode desktop app, which shares the
provider config with `zcode` (and gets its own copy when its settings keep its
data in another folder). A provider you add inside an `aimlapi zcode` session
is saved into aimlapi's per-session file, not ZCode's own, and is gone after
`aimlapi zcode --undo` or `aimlapi logout`: add your providers in a plain
`zcode` session or the desktop app.

## Commands

```sh
aimlapi <agent> [--model <id>] [--config] [--dry-run] [--undo] [-- <agent args>]
aimlapi login [--device]   # sign in explicitly
aimlapi logout             # revoke the CLI's API key
aimlapi status             # balance, key limit and usage
aimlapi models             # models available for an agent
aimlapi update             # update aimlapi to the latest version
aimlapi --version
```

For a permanent `aimlapi` command install it globally:

```sh
npm install -g aimlapi
```

`aimlapi-cli` is the same package under another name (`npx aimlapi-cli claude`,
`npm install -g aimlapi-cli`); it installs the same `aimlapi` command. Install
only one of the two globally.

## Platforms

macOS and Linux on x64 and arm64. **Windows (x64, arm64) is experimental.**

This package is a thin Node.js launcher (Node.js >= 18). The `aimlapi` binary
ships in a platform-specific optional dependency (`@ai-ml.api/cli-<os>-<arch>`)
that npm installs automatically for your OS and CPU; there are no install
scripts. If you see "platform package is not installed", reinstall without
`--omit=optional` / `--no-optional`.

## Links

- AI/ML API: https://aimlapi.com
- Changelog: [CHANGELOG.md](./CHANGELOG.md)

---
_Source: https://npm.io/package/aimlapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
