# POST /ai/edit-text

**Resource:** [AI](./ai.md)  
**Scopes:** `ai:use`  
**Write operation:** yes

Rewrite, improve, translate, summarize, or edit text using AI. Costs 1 credit. Accepts both "text"/"instruction" or "originalText"/"editInstructions" field names.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `text` | body | string | yes | Text to edit (also accepted as "originalText") |
| `instruction` | body | string | yes | Editing instruction, e.g. "make it more professional", "translate to French" (also accepted as "editInstructions") |
| `writingStyle` | body | string | no | Writing style ID (optional) |
| `formContext` | body | object | no | Form context for inline editing (optional) |

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`