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
| Field | Type | Description |
|---|---|---|
success | boolean | Always true for successful requests |
data.styles | array | Valid values for the style parameter |
data.types | array | Valid values for the type parameter |
data.formats | array | Valid values for the output_format parameter |
Styles Reference
| Style | Description |
|---|---|
automatic | Nellie chooses based on your prompt |
action | Fast-paced action sequences |
adventure | Exploration and journey narratives |
alternate_history | Historical “what if” scenarios |
comedy | Humor and lighthearted storytelling |
crime | Criminal investigations and heists |
cyberpunk | High-tech dystopian futures |
drama | Character-driven emotional stories |
dystopian | Oppressive future societies |
epic | Grand-scale narratives |
fable | Moral tales with allegory |
fairy_tale | Magical traditional stories |
fantasy | Magic and mythical worlds |
folklore | Traditional cultural stories |
gothic | Dark, atmospheric horror |
history | Historical fiction |
horror | Fear, dread, and suspense |
legend | Heroic traditional tales |
mystery | Puzzles and detective work |
mythology | Ancient myths retold |
noir | Dark, cynical crime stories |
paranormal | Supernatural elements |
post_apocalyptic | After civilization falls |
psychological | Mind and perception |
romance | Love and relationships |
sci_fi | Science fiction |
superhero | Powers and heroism |
surrealism | Dreamlike and absurd |
suspense | Tension and anticipation |
thriller | High-stakes danger |
tragedy | Stories of downfall |
western | American frontier |
Types Reference
| Type | Description |
|---|---|
automatic | Nellie chooses based on your prompt |
novel | Full-length fiction (characters, plot arcs) |
short_story | Brief narrative (direct plot) |
comic | More illustrations, comic book format |
manga | More illustrations, Japanese-style comic |
childrens | More illustrations, simple followable structure |
non_fiction | Factual, informational content |
textbook | Educational material |
self_help | Personal development/influential guides |
Formats Reference
| Format | Description | Best For |
|---|---|---|
txt | Plain text | Simple reading, processing |
pdf | PDF document | Printing, sharing |
epub | E-book format | E-readers (Kindle, Apple Books) |
md | Markdown | Formatted plain-text markup |
html | Web page | Web publishing |
json | Structured data | Programmatic 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()
Related Endpoints
- POST /v1/book: Use these values when creating stories
- GET /v1/models: Get available AI models
See Also
- API Documentation: Full parameter reference