---
name: vibiz-ai
description: Use AI models through Vibiz Stack - chat with GPT, Claude, Gemini, Kimi, DeepSeek and every major lab's models by id, generate images (Nano Banana, GPT Image), text to speech and transcription, from an agent (MCP tools, CLI) or from an app with one key (OpenAI-compatible, new OpenAI(vibiz.ai)) - with per-call prices, the daily spend ceiling, project budgets and the account's own Google key. Use when an app needs an LLM, images or voice, when you need to generate an image or audio for a project, or someone asks what a model costs or which models they can call.
---

# Vibiz AI

**Connect first.** Not logged in (a tool answers `unauthorized` with `reason: not_logged_in`, or the CLI says "Not logged in")? Run `npx @vibiz/cli login`: show the person the link it prints and ask them to click Authorize (their account is opened on the way if they have none), then go on. Or connect the remote MCP server, nothing to install: `claude mcp add --transport http vibiz https://app.vibiz.app/mcp` (the client opens the same sign-in on first use). Never ask the person to paste a key into the chat. **Keep the CLI current:** a command named here that your `vibiz` doesn't have (an unknown-command or usage error) means the CLI is out of date, not that Vibiz can't do it: run `npm install -g @vibiz/cli@latest` (or `npx -y @vibiz/cli@latest <command>`) and retry, and refresh these skills with `vibiz skills add --global`. Never tell the person something isn't possible because an old CLI lacks the command.

One metered, OpenAI-compatible gateway (`/v1/ai`) for chat, embeddings, images, video, speech and transcription. A **Vibiz model** names what it is for and runs exactly one lab model; any lab model also runs by its own id. Vibiz never swaps in another model: if that one is down, the call fails (`model_unavailable` / `provider_unavailable`).

## Before you start

- **It costs money.** Every call is billed from the account's prepaid credits at the lab's list price plus the AI fee (`markup_pct` on each model, 10% today), and reports what it cost (`cost_usd` on the tools, `cost_micro_usd` over HTTP). Check `vibiz_usage` before a batch: it shows today's spend against the daily ceiling ($5 per account per UTC day by default, AI and web data together; the owner raises it in Billing).
- Bill a project, not the account, when the work is for one: pass `project_id` (from `./vibiz.json`). The project's AI budget then applies, and generated media is kept in its Files with a permanent link (without a project, media links last 24 hours).
- Prices change as labs ship models: `vibiz_ai_models` (or `vibiz ai models`) lists the Vibiz models, the lab model each runs and its price; with a `query` (`"claude opus"`, `"kimi"`) or `all: true` it searches every model you can call (over 400). It is free.

## From an agent

| Want | MCP tool | CLI |
| --- | --- | --- |
| An answer from a model | `vibiz_ai_chat { prompt, system?, model?, max_tokens? (1024, ≤8192), json?, project_id? }` | `vibiz ai "<prompt>" [--model m] [--system s]` |
| Images | `vibiz_image_generate { prompt, size? ("1024x1024"), n? (≤4), model?, project_id?, write_to? (.png) }` | `vibiz image "<prompt>" -o out.png [--size …] [--model m]` |
| Speech (mp3) | `vibiz_speech_create { text (≤4,096 chars), voice?, model?, project_id?, write_to? (.mp3) }` | `vibiz say "<text>" -o out.mp3 [--voice alloy]` |
| A transcript | `vibiz_speech_transcribe { path, language?, model?, project_id? }` (local audio up to 25 MB) | `vibiz transcribe <file> [--language en]` |
| Find a model and its price | `vibiz_ai_models { query?, all? }` | `vibiz ai models [words] [--all]` |

CLI AI commands bill the account, or the project with `--project <id>`. On the remote MCP server `vibiz_speech_transcribe` and `write_to` can't read or write your files: run the CLI command instead. Voices: alloy, ash, coral, echo, fable, nova, onyx, sage, shimmer. `max_tokens × the price` is held against the daily ceiling before a chat runs, so keep it no larger than needed.

## From the app (one key)

The app's server uses `VIBIZ_APP_KEY` (add the `ai` resource with `vibiz add ai` / `vibiz_add_resources { resources: ["ai"] }` for a project AI key; `vibiz dev` gives a development one):

```ts
import OpenAI from 'openai';
import { vibiz } from '@vibiz/app';
const openai = new OpenAI(vibiz.ai);              // baseURL …/v1/ai, the app key
const r = await openai.chat.completions.create({ model: 'vibiz/fast', messages, user: userId });
```

With the `ai` resource the env also has `VIBIZ_AI_BASE_URL` and `VIBIZ_AI_API_KEY` (and `OPENAI_BASE_URL`, `OPENAI_API_KEY`, so `new OpenAI()` works unchanged). Routes: `POST /v1/ai/chat/completions` (streaming, tools, JSON mode), `/v1/ai/embeddings`, `/v1/ai/images/generations`, `/v1/ai/audio/speech`, `/v1/ai/audio/transcriptions`, `/v1/ai/jobs` (video and slow images: `202`, then poll). Pass your own user's id as `user` (or `X-Vibiz-User`) so spend breaks down per end user. The key is a server secret: never in client code.

**Budgets** for an app: `PATCH /v1/projects/<id>/ai { daily_budget_usd, end_user_daily_budget_usd }` (also `rpm`, `tpm`, `concurrency`). Past a budget: `429 rate_limited` with `details.reason` (`daily_spend`, `project_budget`, `end_user_budget`…).

## Pick a model

`vibiz/fast` (default chat, GPT-6 Luna), `vibiz/lite` (DeepSeek V4.1 Flash, cheapest), `vibiz/smart-mini` (Claude Haiku 5.5), `vibiz/balanced` (Gemini 3.8 Flash, 1M context), `vibiz/reasoning` (GPT-6.1 Terra), `vibiz/smart` (Claude Sonnet 5.5), `vibiz/pro` (Claude Opus 5.5), `vibiz/embed`, `vibiz/embed-large`, `vibiz/image` (Nano Banana 2), `vibiz/image-pro` (Nano Banana 2.1), `vibiz/image-text` (GPT-5.4 Image 2, text in the image), `vibiz/video` (LTX-2.5 Fast, jobs only), `vibiz/voice`, `vibiz/voice-pro`, `vibiz/voice-lite` (ElevenLabs voices), `vibiz/transcribe` (Scribe v2). Or a lab id: `anthropic/claude-opus-5.5`, `google/gemini-3.8-flash`, `moonshotai/kimi-k3.1-pro`. A model not in the catalogue is refused (`invalid_request`, `param: "model"`). Quote prices from `vibiz_ai_models`, not from memory.

## The account's own Google key

An account (or one project) can add its own Google key: Google's models then run on the customer's Google account and cost 0 on Vibiz (`paid_by: "your_key"`); nothing falls back to Vibiz if that key fails. `vibiz_ai_keys { project_id? }` shows the status and which models it serves; it never shows or sets a secret. Setting, testing or removing one is the owner's: tell them to run `vibiz ai keys set google` in their own terminal (it reads `GEMINI_API_KEY` or a hidden prompt; `--vertex sa.json` for Google Cloud credits) or use the console (API keys ▸ Your AI keys). Never ask for the key in the chat.

## Never

- Never loop a costly call to "retry"; a `rate_limited` with `daily_spend` resets at midnight UTC: tell the person.
- Out of credits (`402 payment_required`): call `vibiz_billing` and give the person its `top_up_url`. Don't retry.
- Never put `VIBIZ_APP_KEY` or `VIBIZ_AI_API_KEY` in browser code or print them. Rotating the production AI key is the owner's.

**Console links**: `/models` (`?q=claude opus`, `type=llm|image|video|speech|transcription|embeddings`) lists every model with prices; `/projects/<id>/ai` shows a project's AI calls. Results that carry `console_url` open the exact view: give the person that link.

## References

- `references/ai.md`: every model, price, limit, route and error.
- `references/usage.md`: usage, limits and the daily ceiling.
