Canvas Agents
A canvas agent is a canvas-kind agent that powers chart generation on a Canvas. Chart generation uses your own LLM API key (BYOK) — TARX never bills you for canvas tokens.
Creating a Canvas Agent
- Go to Agents → New Agent
- Set Agent Kind to
Canvas - Choose your preferred model (Claude, GPT-4o, Gemini, etc.)
- Select your API key for that provider
- The System Prompt is pre-filled with the ECharts expert template — customize if needed
Recommended Models
| Model | Why |
|---|---|
claude-sonnet-4-6 | Best JSON fidelity, rarely truncates large ECharts configs |
gpt-4o | Fast, reliable JSON output |
gemini/gemini-2.0-flash | Cost-efficient for high-volume generation |
Canvas Agent Defaults
When you create a canvas-kind agent, these execution defaults are applied:
| Setting | Value | Reason |
|---|---|---|
| Max Tokens | 16,000 | ECharts configs with data can be large |
| Timeout | 120s | Allows time for complex chart generation |
| Max Continuations | 1 | Single-call generation (no multi-turn) |
| Context Strategy | truncate | No session history needed |
Attaching an Agent to a Canvas
At Creation
The canvas creation modal requires a canvas agent. The dropdown shows only canvas-kind agents. You cannot create a canvas without selecting one.
In the Canvas Editor
The agent indicator in the Canvas editor top bar shows the currently attached agent. Click it to open a dropdown and switch to a different canvas agent.
- Green/purple: agent configured
- Orange ⚠: no agent — chart generation is disabled until you configure one
The System Prompt
The pre-filled system prompt instructs the agent to:
- Return a valid Apache ECharts
optionJSON object (no markdown, no fences) - Select the optimal chart type for each data relationship
- Apply dark-theme styling (purple palette, dark tooltips)
- Respect label length rules (≤20 chars for axis labels)
- Use
value_countsandhistogram_binsfrom the schema as chart data
You can customize the system prompt to change default chart styles, color palettes, or add domain-specific rules.
The Canvas Skill (automatic)
When you create an agent with kind: canvas, TARX automatically assigns the built-in canvas-expert skill and locks it — the skill picker is hidden for canvas agents. You don't choose it manually; every canvas agent gets the same ECharts-expert instructions merged into its prompt. (The runtime chart generation also uses TARX's built-in ECharts prompts, so JSON fidelity is consistent regardless of the model you pick.)
Why BYOK for Canvas
TARX's platform LLM is used for Bridge (orchestration chat). Canvas chart generation is deliberately separated so:
- You choose the model (not constrained to a platform default)
- You control costs — high-volume chart generation stays on your bill
- You can use different models per canvas (one canvas on Claude, another on GPT-4o)