> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openv2.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AI assistant

> How the chat interface works, what happens when you send a message, and how credits are used.

The **chat panel** is the main control surface in Openv2. You describe what you want; the AI plans, edits your files, and runs commands — all inside your browser. The result shows up in the **Preview** and the **editor** without any manual steps from you.

## What happens when you send a message

Every message goes through the following sequence:

<Steps>
  <Step title="Credits are checked">
    Openv2 confirms you have credits available before the turn starts. If you're out of credits, you'll see a notice prompting you to upgrade or wait for a daily reset.
  </Step>

  <Step title="Your project is shared with the model">
    A snapshot of your current project files is sent to the AI so it sees your code as it actually exists — not a stale version.
  </Step>

  <Step title="The model responds">
    The AI produces a response — text, a plan, or a mix — and may issue tool calls to read files, write files, edit code, search, or run shell commands.
  </Step>

  <Step title="Tool calls run in your WebContainer">
    File edits and shell commands (like `npm install` or `npx expo ...`) are applied directly in your browser's WebContainer. Your `node_modules`, dev server, and Preview all stay in sync.
  </Step>

  <Step title="The turn is saved as a version">
    When the turn completes and files changed, Openv2 saves your chat history and creates a new version snapshot — so you can rewind to this point later.
  </Step>
</Steps>

## Choosing a model

Use the **model selector** in the header to pick which LLM backs your session. The available models depend on your Openv2 plan and provider availability.

* **Stronger models** are better for architecture decisions, complex refactors, and multi-file changes.
* **Faster models** are often enough for small edits, copy changes, and style tweaks.

<Tip>
  If a large refactor goes wrong, switch to a stronger model and ask the AI to explain its plan before writing any code.
</Tip>

## Credits

Openv2 uses a credit system to meter AI usage. Each completed assistant turn typically uses one credit.

| Plan      | Credits                                 |
| --------- | --------------------------------------- |
| **Free**  | Daily allowance (resets each day)       |
| **Pro**   | Larger monthly credit pool via Stripe   |
| **Ultra** | Highest monthly credit tiers via Stripe |

When your credits run out, Openv2 will prompt you to upgrade or wait for the next daily reset. See [Billing & plans](/billing-plans) for current pricing and limits.

## Suggestions and planning blocks

Depending on the assistant mode, the chat UI may show:

* **Suggested follow-up prompts** — quick actions based on where you are in the build.
* **Thinking / planning blocks** — a summary of what the AI intends to do before it writes any code. Review these to confirm direction before large changes.
* **Implementation plans** — structured step-by-step breakdowns for bigger features.

<Info>
  Use planning blocks as a checkpoint. If the plan doesn't match what you want, correct it before the AI starts writing — it's much cheaper than reverting after the fact.
</Info>

## Viewer role

If you were invited to a project as a **viewer**, you can browse the workspace but you cannot use the AI to edit the project. You will see a notice in the chat panel explaining this restriction. To request edit access, ask the project owner to change your role.

<CardGroup cols={2}>
  <Card title="Prompting" icon="pencil" href="/prompting">
    Write prompts that get better results with fewer turns.
  </Card>

  <Card title="Versions & history" icon="clock-rotate-left" href="/versions-history">
    Browse and restore earlier snapshots of your project.
  </Card>

  <Card title="Workbench & editor" icon="code" href="/workbench-editor">
    Edit files manually and monitor the terminal alongside chat.
  </Card>

  <Card title="Billing & plans" icon="credit-card" href="/billing-plans">
    Understand your daily and monthly credit limits.
  </Card>
</CardGroup>
