> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getgranite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Text (AI)

> Apply AI-powered text modifications based on user instructions



## OpenAPI

````yaml post /api/edit_text
openapi: 3.1.0
info:
  title: Axion Backend API
  description: Backend API for Axion platform with desktop automation capabilities
  version: 1.0.0
servers:
  - url: https://api.getgranite.ai
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Organizations
    description: Organization management and membership
  - name: Health
    description: API health and status monitoring
  - name: Automations
    description: Automation planning and execution
  - name: MIG
    description: Managed Instance Group operations
  - name: Agent
    description: Agent execution and streaming
  - name: Onboarding
    description: Organization onboarding flow
  - name: Organization Automations
    description: Organization automation endpoint management
  - name: Organization Endpoints
    description: Public endpoints for organization automations
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/edit_text:
    post:
      tags:
        - Automations
      summary: Edit text using AI
      description: Apply AI-powered text modifications based on user instructions
      operationId: editText
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditTextRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EditTextRequest:
      properties:
        original_text:
          type: string
          title: Original Text
          description: Original full text
        selected_portion:
          type: string
          title: Selected Portion
          description: Selected portion to modify
        instruction:
          type: string
          title: Instruction
          description: Editing instruction
      type: object
      required:
        - original_text
        - selected_portion
        - instruction
      title: EditTextRequest
      description: Request to edit text using AI
    EditTextResponse:
      properties:
        modified_text:
          type: string
          title: Modified Text
          description: Modified complete text
      type: object
      required:
        - modified_text
      title: EditTextResponse
      description: Response from text editing
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````