Polish a draft message in the requested tone.
Rewrites the user's draft message according to the requested tone while preserving meaning, intent, and any technical terms. Used by the chat composer's "Polish with Nu" sparkle button. Returns the rewritten text plus the credits actually billed and the workspace's balance after deduction. Caps: - `text` is capped at 4000 characters (~1000 input tokens). - Output is capped at ~600 tokens server-side. If the workspace has an `aiCustomPreprompt` configured it is prepended as additional system context (workspace-specific guidance to the model).
Rewrites the user's draft message according to the requested tone while preserving meaning, intent, and any technical terms. Used by the chat composer's "Polish with Nu" sparkle button.
Returns the rewritten text plus the credits actually billed and the workspace's balance after deduction.
Caps:
textis capped at 4000 characters (~1000 input tokens).- Output is capped at ~600 tokens server-side.
If the workspace has an aiCustomPreprompt configured it is prepended
as additional system context (workspace-specific guidance to the model).
OAuth 2.1 authorization code flow with PKCE (required of every client, public or confidential). Scopes are a ceiling on the credential, not a grant of access: a token also cannot exceed what the user who approved it may already do. A write scope does not imply its matching read — ask for both.
In: header
Scope: ai:use
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/ai/polish" \ -H "Content-Type: application/json" \ -d '{ "workspaceId": "0193e4a1-b2c3-7000-8000-000000000001", "text": "pls send me the file when u get a sec ty", "toneId": "professional" }'{ "polishedText": "Could you please send me the file when you have a moment? Thank you.", "billedCredits": 3, "balanceAfter": 9997, "eventId": "0193e4a1-b2c3-7000-8000-00000000abcd"}