API Documentation

Integrate AI Story Generator into your applications

Overview

The AI Story Generator API allows you to programmatically generate viral scripts, hooks, and content for your applications. All API endpoints return JSON responses.

API access is available on Pro and higher plans. View Plans

Authentication

All API requests require authentication using an API key. Include your API key in the request header:

Authorization: Bearer YOUR_API_KEY

You can generate an API key from your account settings.

Base URL

https://api.aistorygenerator.com/v1

Generate Script

Generate a complete viral script with hooks, scenes, and more.

Request
POST /generate
Parameters
Parameter Type Required Description
topic string Yes The topic for your script
style string Yes Script style (e.g., "Emotional Drama", "Comedy")
language string No Output language (default: "English")
Example Request
curl -X POST https://api.aistorygenerator.com/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "A dog saves its owner",
    "style": "Emotional Drama",
    "language": "English"
  }'
Example Response
{
  "success": true,
  "data": {
    "script": "...",
    "hooks": ["...", "..."],
    "thumbnails": ["...", "..."],
    "scenes": ["...", "..."],
    "image_prompts": ["...", "..."],
    "titles": ["...", "..."],
    "description": "...",
    "tokens_used": 1500
  }
}

Rate Limits

API rate limits vary by plan:

Plan Requests/Minute Requests/Day
Pro 10 500
Unlimited 30 Unlimited

Error Handling

The API returns standard HTTP status codes:

Code Description
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Rate limit exceeded
500 Server error