---
title: "Generate article"
method: POST
path: "/api/agent/autopilot"
tags: ["Autopilot"]
---

# Generate article

`POST /api/agent/autopilot`

Generate an article from a topic or source URLs. Returns status 'publishing' when auto_publish is true (default) or 'generated' when auto_publish is false (draft mode). The final 'published' status is reflected in GET /api/agent/articles/{id} after the publish pipeline completes.

## Request body

- union
  - object
    - `topic` string, required
    - `source_urls` string[]
    - `language` string
    - `size` 'mini' | 'standard' | 'full' | 'pillar'
    - `mode` 'standard' | 'turbo'
    - `enable_search` boolean
    - `persona` string
    - `illustrations` boolean
    - `audio` boolean
    - `disable_competition` boolean
    - `wait_for_completion` boolean — Wait synchronously for article completion before returning. When false, returns 202 with a job ID for polling via GET /api/agent/articles/{id}.
    - `auto_publish` boolean — Publish article immediately after generation. When false, article stays as draft (status=generated). Uses tenant setting when omitted.
  - object
    - `topic` string
    - `source_urls` string[], required
    - `language` string
    - `size` 'mini' | 'standard' | 'full' | 'pillar'
    - `mode` 'standard' | 'turbo'
    - `enable_search` boolean
    - `persona` string
    - `illustrations` boolean
    - `audio` boolean
    - `disable_competition` boolean
    - `wait_for_completion` boolean — Wait synchronously for article completion before returning. When false, returns 202 with a job ID for polling via GET /api/agent/articles/{id}.
    - `auto_publish` boolean — Publish article immediately after generation. When false, article stays as draft (status=generated). Uses tenant setting when omitted.

## Response `200`

Article generated

- AutopilotResponse
  - `article_id` string, uuid, nullable
  - `title` string, required
  - `slug` string, required
  - `article_url` string, uri — URL where the article will be accessible once published. For draft articles (auto_publish: false), this URL will return 404 until the article is published.
  - `status` 'publishing' | 'generated', required — publishing — article generation complete, publish pipeline triggered (will be live within seconds). generated — draft article, not yet published (use article.publish to make it live).
  - `mode` string
  - `word_count` integer, required
  - `credits_used` number, required
  - `estimated_total_credits` number
  - `extensions` object
  - `extraction_results` object[]

## Other responses

- `202` — Article generation accepted for async processing. Poll GET /api/agent/articles/{id} with the same Authorization: Bearer <AGENT_API_KEY> header for status.
- `400` — Bad request
- `401` — Unauthorized
- `402` — Insufficient credits
- `429` — Rate limit exceeded
- `500` — Internal server error

## Changes

> 28 revisions in range; 1 could not be searched.

- **2026-04-08** `7cc54edf9ffd` — 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - added `subschema #1, subschema #2` to the request body `anyOf` list
- **2026-04-08** `825a12db7cea` — 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - added `subschema #1, subschema #2` to the request body `anyOf` list
- **2026-03-08** `7ee91cd6fa9d` — 1 breaking, 2 warning, 1 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - added the new `generated` enum value to the `status` response property for the response status `200`
  - added the new `publishing` enum value to the `status` response property for the response status `200`
  - added `subschema #1, subschema #2` to the request body `anyOf` list
- **2026-03-07** `dbe86d041f0a` — 1 breaking, 2 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - added `subschema #1, subschema #2` to the request body `anyOf` list
  - added the success response with the status `202`
- **2026-03-01** `2df2182b5901` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/citedy/apis/citedy-agent-api/changes/api/agent/autopilot/post.md)

---

[API](https://skmtc.dev/citedy/apis/citedy-agent-api.md) · [All operations](https://skmtc.dev/citedy/apis/citedy-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/citedy/citedy-agent-api/revisions/b5785d3fe446/schema)
