# Treechat AI: Frontier models. No subscriptions. One command.

treecli and the Treechat MCP server put image, video, music and voice models (OpenAI, Google, xAI, ByteDance, Kling, Suno, ElevenLabs and more) behind one command and one tool catalog. Pay per use, no subscription.

## Quick start for agents

1. Install: `curl -fsSL https://raw.githubusercontent.com/Knovigator/treecli/main/install.sh | sh`
2. Run `treecli connect` and give your person the link it prints. They sign in or sign up (email, Google or X), check the code, choose a daily spending limit, approve, and can add a card. Never ask for their password.
3. Learn the models: `treecli generate actions --verbose`, or `treecli generate describe <action>`.
4. Quote, then generate within an approved cap:
   `treecli generate flux2 "wide hero banner" --out banner.webp --quote`
   `treecli generate flux2 "wide hero banner" --out banner.webp --max-price-cents 100`

treecli prints JSON when its output isn't a terminal; progress goes to stderr. Exit codes: 0 ok, 1 error, 2 usage, 3 not connected, 4 spending refused (price cap, daily limit or billing), 5 not found, 6 rate limited.

## MCP

Hosted server: `https://api.treechat.com/mcp` (OAuth; the first call opens the same sign-in, approval and spending-limit page).

- Claude Code: `claude mcp add --transport http treechat https://api.treechat.com/mcp`
- Codex: `codex mcp add treechat --url https://api.treechat.com/mcp`
- Cursor and others: `{ "mcpServers": { "treechat": { "url": "https://api.treechat.com/mcp" } } }`
- Local, over treecli's own connection: `treecli mcp serve`

## Models and prices

The live catalog, with the list price of one default generation per model, is JSON at https://api.treechat.com/api/v1/ai/catalog (no account needed). Longer durations, higher resolutions and reference media can cost more; `--quote` (or the `quote_generation` tool) gives the exact price.

## Spending controls

- Every generation is quoted first and needs a price cap (`--max-price-cents`); a quote over the cap is refused before anything is charged.
- Each connected app has a daily limit chosen at approval ($1, $5, $20, $100 or none, over any 24 hours). Calls past it are refused with `daily_limit_reached`.
- Pay in USD (Stripe, pay as you go) or Bitcoin SV. Retries with the same quote and idempotency key are never charged twice.

## Chaining

Every run has an id. Pass `--reference run:<id>` to feed one model's output into the next (image → edit → animate → sound), or `--reference @file` to upload local media.

More: https://treechat.com/cli · https://github.com/Knovigator/treecli · https://docs.treechat.com
