AI Story Generator
Playground
Try it on WaveSpeedAI!AI Story Generator creates stories from a theme or idea with customizable genre, length, perspective, audience, and format. Ready-to-use REST inference API, no coldstarts, affordable pricing.
Features
AI Story Generator turns your ideas into fully-formed stories — instantly. Give it a theme, pick a genre, and watch a complete narrative unfold. Whether you need a bedtime fairy tale, a sci-fi thriller, or a romantic drama, this AI has a story for every occasion.
Why Choose This?
-
Idea to story in seconds Drop in a theme or concept, and get a complete, polished story back. Writer’s block? Never heard of her.
-
Any genre you want Fantasy, romance, mystery, sci-fi, thriller, horror, comedy — name your flavor.
-
Customizable length Quick 500-word flash fiction or an immersive 3,000-word tale. You decide.
-
Choose your perspective First person for intimacy, third person for scope, second person for that choose-your-own-adventure vibe.
-
Audience-aware Kid-friendly fairy tales, edgy teen drama, or mature adult fiction — tailored to your readers.
-
Multiple formats Short stories, fables, fairy tales, scripts, and more.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
| prompt | Yes | — | Your story idea, theme, or concept |
| genre | No | auto | fantasy, romance, mystery, sci-fi, thriller, horror, comedy… |
| length | No | medium | short (~500 words), medium (~1500), long (~3000) |
| narrative_perspective | No | auto | first person, second person, third person |
| audience | No | auto | children, teens, adults |
| format | No | auto | short story, fairy tale, fable, script, and more |
How to Use
- Enter your idea — a theme, concept, character, or scenario. Be vague or specific — AI adapts.
- Pick your settings — genre, length, perspective, audience, format. Or leave on auto and let AI decide.
- Generate — click and watch your story come to life.
- Enjoy — read, edit, share, or use as inspiration.
Pricing
| Output | Cost |
|---|---|
| Per story | $0.035 |
Best Use Cases
- Creative writing — Overcome writer’s block or spark new ideas.
- Bedtime stories — Custom tales for kids, starring whoever you want.
- Content creation — Blog posts, social media stories, marketing narratives.
- Education — Teaching story structure, genre conventions, or creative writing.
- Entertainment — Generate stories for fun, games, or reading aloud.
- Screenwriting practice — Get script-format output to study dialogue and pacing.
- Gift ideas — Personalized stories featuring friends or family members.
Pro Tips
- The more specific your prompt, the more tailored your story. “A dragon” vs “A shy dragon who runs a bakery” — big difference.
- Let AI pick the genre if you want to be surprised.
- Use “children” audience for clean, wholesome content.
- Try “script” format for dialogue-heavy output.
- Generate multiple stories from the same prompt — each one will be unique.
Notes
- Prompt is the only required field.
- All other parameters default to “auto” or “medium” if not specified.
- Stories are original AI-generated content.
- Perfect for inspiration — feel free to edit and make it your own.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"genre": "auto",
"length": "medium",
"narrative_perspective": "auto",
"audience": "auto",
"format": "auto"
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/ai-story-generator" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL=$(printf '%s' "${TASK}" | jq -r '.urls.get // empty')
if [ -z "${RESULT_URL}" ]; then RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"; fi
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
created|processing) sleep 2 ;;
*) printf 'Unexpected status: %s
' "${STATUS}" >&2; exit 1 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | - | Story theme or idea. | |
| genre | string | No | auto | auto, fantasy, romance, mystery, sci-fi, thriller, horror, comedy, drama, adventure | Story genre. |
| length | string | No | medium | short, medium, long | Story length: short (~500 words), medium (~1500 words), long (~3000 words). |
| narrative_perspective | string | No | auto | auto, first person, second person, third person | Narrative perspective. |
| audience | string | No | auto | auto, children, teens, adults | Target audience. |
| format | string | No | auto | auto, short story, fairy tale, fable, script, poem, letter | Story format. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to retrieve the prediction result |
| data.status | string | Status of the task: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to poll for the prediction result |
| data.status | string | Status: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |