---
title: "Create AI page"
method: POST
path: "/links/page"
tags: ["Pages"]
---

# Create AI page

`POST /links/page`

## Request

- Base URL: `https://api.short.io`
- URL: `https://api.short.io/links/page`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/short/apis/short-io-api-2/docs/links/page/post.ts> (a function with typed inputs; its response is checked against the schema)

Generates a self-contained HTML page from a prompt and serves it at a new short link. Responds with an `application/x-ndjson` stream, one JSON event per line: `start` (`maxOutputTokens`), `heartbeat` (`elapsedMs`, `outputChars`) at least every 10 seconds while the page is generated, then exactly one terminal event - `done` (`page`) or `error` (`code`, `status`, `message`). `code` is `prompt_rejected` (400), `generation_failed` (502), `generation_timeout` (504), `link_refused` (the status the link write was refused with) or `internal_error` (500). Refusals decided before generation starts are ordinary JSON replies with their status code.

## Request body

- object
  - `DomainId` number, required: Domain ID where the page will be created
  - `path` string: Short link path (auto-generated if omitted)
  - `title` string: Link title (taken from the generated page's <title> if omitted)
  - `prompt` string, required: What the page should be. The HTML is generated from it and cannot be edited directly

## Other responses

- `400`: Default Response
- `402`: Default Response
- `403`: Default Response
- `409`: Default Response
- `500`: Default Response
- `503`: Default Response

## Changes

> 9 revisions in range; 1 not diffed.

- **2026-11-03** `1152ff5ece4d`: 1 info
  - endpoint added
- **2026-11-03** `e787ffbc6947`: 1 breaking
  - api path removed without deprecation
- **2026-10-28** `e60645055120`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/short/apis/short-io-api-2/changes/links/page/post.md)

---

[API](https://skmtc.dev/short/apis/short-io-api-2.md) - [All operations](https://skmtc.dev/short/apis/short-io-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/short/apis/short-io-api-2/revisions/75e8b589c8c5?raw)
