GraphQL AI Text Mutations

The AI Text mutations provide AI-powered content generation, refinement, translation, transcription, and file description capabilities through the GraphQL API. All mutations require authentication.

write

Generate text content from a prompt, optionally using existing files as reference context.

mutation {
  write(prompt: "Write a product description for a wireless headphone", context: "tech blog, casual tone", files: ["file-id-1"])
}

Arguments:

Argument Type Description
prompt String! Text description of the content to generate (required)
context String Additional context to guide the writing style and tone
files [String!] List of file IDs to use as reference material

Returns: String — The generated text content.

Example response:

{
  "data": {
    "write": "Experience crystal-clear audio with our latest wireless headphones..."
  }
}

refine

Refine existing page content using AI. Pass a prompt describing the desired changes along with the current content structure.

mutation {
  refine(
    prompt: "Make the tone more professional and add a call to action",
    content: [{"type": "text", "data": {"text": "Check out our cool stuff!"}}],
    type: "text",
    context: "corporate landing page"
  )
}

Arguments:

Argument Type Description
prompt String! Text description of the desired refinements (required)
content JSON! The existing content elements to refine (required)
type String The content element type to focus on
context String Additional context to guide the refinement

Returns: JSON — The refined content elements in the same structure as the input.

Example response:

{
  "data": {
    "refine": [
      {
        "type": "text",
        "data": {
          "text": "Discover our premium solutions designed to elevate your business. Contact us today to schedule a consultation."
        }
      }
    ]
  }
}

synthesize

Generate complete pages and content structures from prompts, optionally using existing files as reference.

mutation {
  synthesize(
    prompt: "Create a landing page for a SaaS product with hero, features, and pricing sections",
    context: "modern tech startup",
    files: ["file-id-1", "file-id-2"]
  )
}

Arguments:

Argument Type Description
prompt String! Text description of the page or content to generate (required)
context String Additional context to guide the generation
files [String!] List of file IDs to use as reference material

Returns: String — The generated page content.

Example response:

{
  "data": {
    "synthesize": "[{\"type\":\"heading\",\"data\":{\"text\":\"Streamline Your Workflow\"}},...]"
  }
}

describe

Generate a text summary or description of a file's content using AI. Useful for auto-generating alt text for images or descriptions for documents.

mutation {
  describe(file: "0187d6ab-b76d-75ee-8b0d-1b59cc3a1ab7", lang: "en")
}

Arguments:

Argument Type Description
file String! The ID of the file to describe (required)
lang String ISO language code for the description output

Returns: String — A text description of the file content.

Example response:

{
  "data": {
    "describe": "A panoramic photograph of a coastal city at dusk, featuring illuminated buildings along the waterfront with mountains in the background."
  }
}

transcribe

Transcribe an uploaded audio file to text using AI speech recognition.

mutation Transcribe($file: Upload!) {
  transcribe(file: $file)
}

Arguments:

Argument Type Description
file Upload! The audio file to transcribe (required)

Returns: JSON — The transcription result.

Example response:

{
  "data": {
    "transcribe": {
      "en": "Welcome to our podcast. Today we are discussing the future of content management systems..."
    }
  }
}

translate

Translate one or more text strings to a target language using AI.

mutation {
  translate(
    texts: ["Welcome to our website", "Learn more about our products"],
    to: "de",
    from: "en",
    context: "corporate website"
  )
}

Arguments:

Argument Type Description
texts [String!]! Array of text strings to translate (required)
to String! Target ISO language code, e.g. de, fr, es (required)
from String Source ISO language code (auto-detected if omitted)
context String Additional context to improve translation quality

Returns: [String!]! — Array of translated strings in the same order as the input.

Example response:

{
  "data": {
    "translate": [
      "Willkommen auf unserer Website",
      "Erfahren Sie mehr über unsere Produkte"
    ]
  }
}