All guides

Cloptima CLI Getting Started

Install the Cloptima CLI, authenticate, and run your first LLM spend and governance commands in minutes.

7 min read Updated May 2026CLI and MCP server
On this page
  1. 01Install in Under a Minute
  2. 02Authenticate Securely
  3. 03Verify Setup
  4. 04Run Your First Queries
  5. 05Find Savings and Risks
  6. 06Go Beyond Basic Reporting
  7. 07Next Steps

01

Install in Under a Minute

On macOS, install via Homebrew: brew tap cloptima/tap && brew install cloptima-cli. If you prefer containers, use docker.io/cloptimaai/cloptima-cli:latest. The executable command is cloptima in both cases.

02

Authenticate Securely

For local development, run cloptima auth login to store credentials in your OS keychain. For automation, set CLOPTIMA_ACCESS_TOKEN as an environment variable. This keeps secrets out of shell history and lets pipelines run non-interactively.

03

Verify Setup

Start with cloptima version, then cloptima auth status to confirm which credential the CLI uses before running deeper analysis commands.

04

Run Your First Queries

Use cloptima llm spend --window 30d for a fast summary of model spend. Then use cloptima llm breakdown --window 30d --group-by model to see spend by model, or --group-by team_id or app_id to see it by owner. Add --output json when you want to feed results into automation or AI workflows.

05

Find Savings and Risks

Run cloptima llm intelligence entities to inspect cost and optimization findings and cloptima llm policy-violations summary to see which requests your policies blocked, and which continued because a guardrail scan could not run, by reason, policy, and app. These two commands usually surface the fastest first-week wins.

06

Go Beyond Basic Reporting

Teams typically expand from spend reporting into gateway key management, guardrail review, unit economics, and showback. Common next commands include cloptima llm gateway-keys list, cloptima llm governance guardrails list, cloptima llm unit-economics report, cloptima llm showback export, and cloptima llm credits.

07

Next Steps

For team onboarding, share this setup with engineering and FinOps stakeholders. Then move to MCP setup so the same queries run from your AI assistant and agent workflows.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free plan