Flarite Docs

How It Works

A look at the Flarite AI agent loop — from your prompt to the final structured result.

The Agent Loop

When you send a prompt, Flarite doesn't just call a language model and return the text. It runs an agentic loop — the AI can call real API tools, inspect results, and continue reasoning until it has a complete answer.

1
You send a prompt
Entered in the chat bar in the Flarite dashboard or mobile app.
2
Flarite prepares context
Your active integration, selected token ID, and timezone are attached to the request.
3
AI decides which tools to call
The LLM selects from the available tools (e.g. list_zones, get_customer, run_sql) based on your intent.
4
Tools call real APIs
Each tool decrypts your stored token and makes a live API call to the relevant provider.
5
AI synthesizes the response
Results are returned to the AI which summarizes, formats, and presents structured data to you.

Tool Calling

Flarite provides the AI with a set of typed tool definitions — one set per provider. Each tool maps to a real API endpoint. For example, the Cloudflare integration exposes tools likelist_zones, add_dns_record, get_worker_detail, and dozens more.

The AI model chooses which tools to invoke based on your prompt — and can chain multiple tool calls in a single response cycle. This means a prompt like "find any zone where the SSL mode is Flexible and change them all to Full" can trigger multiple API calls automatically.

⚠️
ImportantActions that modify data (like changing DNS records, cancelling subscriptions, or deleting objects) will always be shown to you for confirmation before they are applied. You are always in control.

Token Security During Tool Calls

Your API token is never sent to the AI model. It is only decrypted at the moment a tool makes an API call — server-side, in the Cloudflare Worker. The model only sees the results of the API call, not your credentials.

See Security Model and Token Encryption for full details.

Prompt Counting

Each call to /api/ai/command counts as one prompt against your monthly limit, regardless of how many tool calls the agent makes internally. The counter is shared across all providers — switching from Cloudflare to Stripe uses the same pool. See Plans & Limits.

Model

By default, Flarite uses Cloudflare Workers AI to run a high-quality open model. Users on eligible plans can enable Bring Your Own Model (BYOM) — letting you use your own Cloudflare AI account with unlimited prompts.