---
title: "Rewrite text"
method: POST
path: "/ai/rewrite/v1"
tags: ["/ai"]
---

# Rewrite text

`POST /ai/rewrite/v1`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/ai/rewrite/v1`
- Auth: HTTP bearer

Drafts a rewrite of the caller's text in the requested tone and length, for them to review. | authz: allowed_org_types=[shipper, provider], min_org_role=operator | (AIRewriteReq) -> (AIRewriteRes)

## Request body

- AIRewriteReq
  - `text` string, required: The text to rewrite: typed, dictated, or pasted.
  - `user_prompt` string, nullable: Freeform instructions for this rewrite, such as who it's for. They take precedence over tone and length.
  - `effort` 'low' | 'medium' | 'high'
  - `tone` 'casual' | 'neutral' | 'formal'
  - `length` 'shorter' | 'same' | 'longer'

## Response `200`

Successful Response

- AIRewriteRes
  - `rewritten_text` string, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-29** `6f428e2e2b98`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/chrt/apis/chrt-fastapi/changes/ai/rewrite/v1/post.md)

---

[API](https://skmtc.dev/chrt/apis/chrt-fastapi.md) - [All operations](https://skmtc.dev/chrt/apis/chrt-fastapi/llms.txt) - [OpenAPI document](https://skmtc.dev/chrt/apis/chrt-fastapi/revisions/6f428e2e2b98?raw)
