---
title: "Generate content using AI"
method: POST
path: "/aiwriter/generate"
tags: ["plugin-api"]
---

# Generate content using AI

`POST /aiwriter/generate`

## Request body

- AiGenerateRequest
  - `prompt` string, required
  - `type` string
  - `title` string
  - `max_length` integer
  - `style` string

## Response `200`

Generated content

- AiGenerateResponse
  - `content` string
  - `tokens_used` integer
  - `model` string
  - `generated_at` string, date-time

---

[API](https://skmtc.net/sphireinc/apis/foundry-api.md) · [All operations](https://skmtc.net/sphireinc/apis/foundry-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sphireinc/foundry-api/versions/3696c13096d0/schema)
