Skip to Content
Guides/Modes

Modes

Pass a writing mode explicitly — business, academic or creative — or let the API pick.

swim-1.0 supports three writing modes:

modeFor
businessWriting for work: emails, reports, proposals, plans, marketing and sales copy, product, legal and internal documents
academicScholarly or educational writing: essays, papers, theses, abstracts, literature reviews, study notes, explaining a subject with sources
creativeCreative and personal writing: fiction, poetry, scripts, lyrics, memoir, personal essays and letters, speeches and toasts

Pick a mode, or let the API pick

Pass mode in the request body, on /v1/messages and /v1/chat/completions alike:

mode
left outThe API chooses business, academic or creative for each request based on your system prompt and the latest user message
business, academic, creativeUses that mode directly

Any other value answers 400 invalid_request_error.

curl https://api.strokes.ink/v1/messages \
  -H "x-api-key: $STROKES_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "swim-1.0",
    "mode": "business",
    "messages": [
      {
        "role": "user",
        "content": "Write a follow-up to the client: they want a quote by Thursday."
      }
    ]
  }'

Name the mode when your product already knows the kind of writing — a "Write an email" action, an academic editor, a fiction workspace. Leave it out in an open chat or an agent, where any request can come.

Which mode was used

Responses carry the strokes-mode header (business, academic or creative) whenever a mode was set or automatically chosen. With the SDKs, read it from the raw response — client.messages.create(…).withResponse() in TypeScript, client.messages.with_raw_response.create(…) in Python. The console also shows the mode of each request (and whether it was auto-picked) on the Activity page.

How automatic selection works

When mode is left out, the API classifies the request from your system prompt and the latest user message before answering. Classification takes a few hundred milliseconds and isn't billed. If a request has no user text or classification times out, the request proceeds without a mode and omits the strokes-mode header.

On this page