---
title: "POST /ai/generate-prompt"
method: POST
path: "/ai/generate-prompt"
tags: ["/ai/"]
---

# POST /ai/generate-prompt

`POST /ai/generate-prompt`

## Request

- Base URL: `https://api.novelai.net` (the document declares no server; this is the origin it was published from)
- URL: `https://api.novelai.net/ai/generate-prompt`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/novelai/apis/novelai-primary-api/docs/ai/generate-prompt/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- AiGeneratePromptRequest
  - `model` '2.7B' | '6B-v4' | 'euterpe-v2' | 'genji-python-6b' | 'genji-jp-6b' | 'genji-jp-6b-v2' | 'krake-v2' | 'hypebot' | 'infillmodel' | 'cassandra' | 'sigurd-2.9b-v1' | 'blue' | 'red' | 'green' | 'purple' | 'clio-v1' | 'kayra-v1', required: Used text generation model
  - `prompt` string, required: Input for the text generation model
  - `temp` number, required
  - `tokens_to_generate` number, required

## Response `201`

Prompt has been generated.

- AiGeneratePromptResponse
  - `generated_text` string, required

## Other responses

- `401`: Access Token is incorrect.
- `500`: An unknown error occured.

---

[API](https://skmtc.dev/novelai/apis/novelai-primary-api.md) - [All operations](https://skmtc.dev/novelai/apis/novelai-primary-api/llms.txt) - [OpenAPI document](https://skmtc.dev/novelai/apis/novelai-primary-api/revisions/cf1e524380e2?raw)
