One prompt. A finished book.

Open Nellie Sign in

GET /v1/configuration

Retrieve valid options for book generation parameters.

Overview

This endpoint returns the available values for styles, types, and output_formats. Use it to dynamically populate dropdowns or validate user input in your application.

Endpoint

GET https://api.nelliewriter.com/v1/configuration

Authentication

Not required. This is a public endpoint.

Example Request

cURL

curl https://api.nelliewriter.com/v1/configuration

Python SDK

from nellie_api import Nellie

client = Nellie(api_key="nel_your_api_key")
config = client.get_configuration()

print(f"Styles: {config.styles}")
print(f"Types: {config.types}")
print(f"Formats: {config.formats}")

Python (requests)

import requests

response = requests.get("https://api.nelliewriter.com/v1/configuration")
data = response.json()

print(data["data"]["styles"])

JavaScript

const response = await fetch('https://api.nelliewriter.com/v1/configuration');
const { data } = await response.json();

console.log('Available styles:', data.styles);
console.log('Available types:', data.types);
console.log('Available formats:', data.formats);

Response

Success (200 OK)

{
  "success": true,
  "data": {
    "styles": [
      "automatic",
      "action",
      "adventure",
      "alternate_history",
      "comedy",
      "crime",
      "cyberpunk",
      "drama",
      "dystopian",
      "epic",
      "fable",
      "fairy_tale",
      "fantasy",
      "folklore",
      "gothic",
      "history",
      "horror",
      "legend",
      "mystery",
      "mythology",
      "noir",
      "paranormal",
      "post_apocalyptic",
      "psychological",
      "romance",
      "sci_fi",
      "superhero",
      "surrealism",
      "suspense",
      "thriller",
      "tragedy",
      "western"
    ],
    "types": [
      "automatic",
      "novel",
      "comic",
      "non_fiction",
      "manga",
      "textbook",
      "childrens",
      "self_help",
      "short_story"
    ],
    "formats": [
      "txt",
      "pdf",
      "epub",
      "md",
      "html",
      "json"
    ]
  }
}

Response Fields

FieldTypeDescription
successbooleanAlways true for successful requests
data.stylesarrayValid values for the style parameter
data.typesarrayValid values for the type parameter
data.formatsarrayValid values for the output_format parameter

Styles Reference

StyleDescription
automaticNellie chooses based on your prompt
actionFast-paced action sequences
adventureExploration and journey narratives
alternate_historyHistorical “what if” scenarios
comedyHumor and lighthearted storytelling
crimeCriminal investigations and heists
cyberpunkHigh-tech dystopian futures
dramaCharacter-driven emotional stories
dystopianOppressive future societies
epicGrand-scale narratives
fableMoral tales with allegory
fairy_taleMagical traditional stories
fantasyMagic and mythical worlds
folkloreTraditional cultural stories
gothicDark, atmospheric horror
historyHistorical fiction
horrorFear, dread, and suspense
legendHeroic traditional tales
mysteryPuzzles and detective work
mythologyAncient myths retold
noirDark, cynical crime stories
paranormalSupernatural elements
post_apocalypticAfter civilization falls
psychologicalMind and perception
romanceLove and relationships
sci_fiScience fiction
superheroPowers and heroism
surrealismDreamlike and absurd
suspenseTension and anticipation
thrillerHigh-stakes danger
tragedyStories of downfall
westernAmerican frontier

Types Reference

TypeDescription
automaticNellie chooses based on your prompt
novelFull-length fiction (characters, plot arcs)
short_storyBrief narrative (direct plot)
comicMore illustrations, comic book format
mangaMore illustrations, Japanese-style comic
childrensMore illustrations, simple followable structure
non_fictionFactual, informational content
textbookEducational material
self_helpPersonal development/influential guides

Formats Reference

FormatDescriptionBest For
txtPlain textSimple reading, processing
pdfPDF documentPrinting, sharing
epubE-book formatE-readers (Kindle, Apple Books)
mdMarkdownFormatted plain-text markup
htmlWeb pageWeb publishing
jsonStructured dataProgrammatic access, custom

Use Cases

Populating a Dropdown

async function populateStyleDropdown() {
  const response = await fetch('https://api.nelliewriter.com/v1/configuration');
  const { data } = await response.json();
  
  const select = document.getElementById('style-select');
  data.styles.forEach(style => {
    const option = document.createElement('option');
    option.value = style;
    option.textContent = style.replace('_', ' ').replace(/\b\w/g, c => c.toUpperCase());
    select.appendChild(option);
  });
}

Validating User Input

import requests

def validate_story_params(style, type_, output_format):
    response = requests.get("https://api.nelliewriter.com/v1/configuration")
    config = response.json()["data"]
    
    errors = []
    if style not in config["styles"]:
        errors.append(f"Invalid style: {style}")
    if type_ not in config["types"]:
        errors.append(f"Invalid type: {type_}")
    if output_format not in config["formats"]:
        errors.append(f"Invalid format: {output_format}")
    
    return errors

Caching Configuration

Since configuration rarely changes, you can cache the response:

from functools import lru_cache
import requests

@lru_cache(maxsize=1)
def get_config():
    response = requests.get("https://api.nelliewriter.com/v1/configuration")
    return response.json()["data"]

# First call fetches, subsequent calls use cache
config = get_config()

See Also