ChatML is the shape most chat APIs already expect: an ordered list of system, user, and assistant messages. Pasting that list into a single text box hides two things that matter when you ship it — which role owns each instruction, and how much of the token budget is framing rather than content.
The Prompt Editor has a ChatML mode for that. Messages stay in your browser. Nothing is sent to an account or a rewrite API.
When to use ChatML mode
Use Text / Markdown when the prompt is one block: a summary instruction, a translation template, or notes you will paste into a single user message.
Switch to ChatML messages when:
- The system prompt must stay separate from the user turn
- You are replaying a few-shot conversation (user, assistant, user)
- You need JSON you can drop into an OpenAI-style
messagesarray
Open the editor, set Mode to ChatML messages, and add cards with + System, + User, and + Assistant.
A small system prompt that stays out of the user turn
A code-review prompt is a clear split. The role and review rules belong on the system card. The code under review belongs on the user card.
System:
You are a senior TypeScript engineer doing a careful code review.
Focus on correctness, security, performance, and maintainability.
Be specific. Do not rewrite the whole file unless asked.
User:
Review this change for security.
```typescript
export function isAdmin(role: string) {
return role == "admin"
}
The same pattern is the built-in **Code review** template on [Templates](/templates). ChatML mode is how you edit that split after you leave the template.
Each card shows two counts: content tokens, and tokens including message framing. The sidebar total includes that overhead. If you only count the words you typed, you will understate what the API bills.
## Export JSON you can paste into a request
**Copy ChatML JSON** writes the current cards as a message array. **Export** can save plain text, Markdown, or that JSON. Text mode is different: copying ChatML there wraps the whole buffer as a single user message, which is what you want for a one-shot prompt and the wrong shape for a system prompt.
A typical export looks like this:
```json
{
"messages": [
{ "role": "system", "content": "You are a senior TypeScript engineer..." },
{ "role": "user", "content": "Review this change for security.\n..." }
]
}
Check the target model in the editor before you export. OpenAI models use an exact tokenizer. Other vendors show an estimate. For a finer Qwen or GLM count, use Send to TokenWorkbox — see checking tokens before the context window.
Bring an existing transcript in
You do not have to retype a conversation you already have.
- Import accepts ChatML JSON, a ChatGPT page copy, or Markdown that already looks like turns
- After import, the draft opens in the editor so you can fix roles before export
- If a pasted chat buried the instructions inside the first user bubble, move them onto a system card and save a snapshot — version compare is the place to diff that change
What this editor will not do
It does not call a model, store the thread in the cloud, or rewrite the wording for you. Drafts sit in localStorage on this device. Clear draft deletes that local copy.
If the text is still one block with {{variables}}, start from a template and switch to ChatML only when the system and user roles need to diverge. For retrieval prompts, the next step is the RAG prompt builder walkthrough.