Skip to main content

@apertis/cli

@apertis/cli is a small terminal tool for the Apertis API gateway. See your usage and spend, list 500+ models, and benchmark latency, throughput, and real measured cost across models — straight from your terminal.

GitHub: apertis-ai/apertis-cli · npm: @apertis/cli

Installation

npm install -g @apertis/cli

Or run it without installing:

npx @apertis/cli usage

Requires Node.js 18+.

Authentication

Get an API key from the Apertis Dashboard, then provide it any of these ways (highest precedence first):

apertis --key sk-... usage          # 1. per-command flag
export APERTIS_API_KEY=sk-... # 2. environment variable
apertis config set-key sk-... # 3. saved to ~/.apertis/config.json (chmod 0600)
Security

A key passed as a command argument (--key, config set-key) can be captured by shell history and process listings. On sensitive or shared machines, prefer APERTIS_API_KEY or the saved config file. The CLI never prints your full key — it is masked in all output and redacted from error messages.

Commands

apertis usage

Your API key's lifetime usage and spend.

apertis usage
apertis usage --json

apertis models

List available models, with optional filters.

apertis models
apertis models --owner openai
apertis models --search claude
apertis models --json

apertis benchmark <models...>

Benchmark one or more models head-to-head. Reports client-measured latency (avg / p50), Apertis's server-side latency, throughput (tokens/sec), and the actual measured cost of the run.

apertis benchmark gpt-4o-mini claude-sonnet-4-6
apertis benchmark gpt-4o-mini -n 5 --prompt "Summarize the theory of relativity."
apertis benchmark gpt-4o-mini --json

Cost is measured from your key's used_quota_usd delta over the run — so it reflects real spend rather than a pricing-table estimate. (Best-effort: concurrent use of the same key during a benchmark can inflate it.)

apertis config

apertis config set-key sk-...       # save key (and optionally --base-url)
apertis config show # show saved config (key masked)

Global flags

FlagDescription
-k, --key <key>API key (overrides env and config file)
--base-url <url>API base URL (default https://api.apertis.ai/v1)
--jsonMachine-readable JSON output