GET /v1/models #
Retrieve available Nellie AI models and their credit costs.
Overview #
This endpoint returns a list of available Nellie AI models with their names, descriptions, and credit costs per book. Use it to display model options to users or calculate expected costs.
Endpoint #
GET https://api.nelliewriter.com/v1/models
Authentication #
Not required. This is a public endpoint.
Example Request #
cURL #
curl https://api.nelliewriter.com/v1/models
Python SDK #
from nellie_api import Nellie
client = Nellie(api_key="nel_your_api_key")
models = client.get_models()
for model in models:
print(f"{model.name}: {model.cost_per_book} credits")
Python (requests) #
import requests
response = requests.get("https://api.nelliewriter.com/v1/models")
data = response.json()
for model in data["data"]:
print(f"{model['name']}: {model['cost_per_book']} credits")
JavaScript #
const response = await fetch('https://api.nelliewriter.com/v1/models');
const { data } = await response.json();
data.forEach(model => {
console.log(`${model.name}: ${model.cost_per_book} credits`);
});
Response #
Success (200 OK) #
{
"success": true,
"data": [
{
"id": "2.0",
"name": "Nellie 2.0 (Standard)",
"description": "Balanced performance for fast standard books.",
"cost_per_book": 250
},
{
"id": "3.0",
"name": "Nellie 3.0 (Premium)",
"description": "Higher creativity and coherence for complex plots.",
"cost_per_book": 500
}
]
}
Response Fields #
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true for successful requests |
data |
array | List of available models |
data[].id |
string | Model identifier (use in POST /v1/book) |
data[].name |
string | Human-readable model name |
data[].description |
string | Model capabilities description |
data[].cost_per_book |
integer | Base credits per generation |
Available Models #
Nellie 2.0 (Standard) #
| Property | Value |
|---|---|
| ID | "2.0" |
| Cost | 250 credits |
| Speed | Fast |
| Quality | Good |
Best for:
- Standard novels
- High-volume generation
- Cost-conscious projects
- Bulk generation
- Complex narratives with multiple plot threads
- Character-driven dramas
- Projects requiring high coherence
- Professional-quality output
Nellie 3.0 (Premium) #
| Property | Value |
|---|---|
| ID | "3.0" |
| Cost | 500 credits |
| Speed | Slower |
| Quality | Excellent |
Best for:
Model Comparison #
| Feature | Nellie 2.0 | Nellie 3.0 |
|---|---|---|
| Cost | 250 credits | 500 credits |
| Speed | ~20-30 min | ~45-80 min |
| Plot complexity | Good | Excellent |
| Character depth | Great | Excellent |
| Coherence | Excellent | Excellent |
| Creativity | Great | Excellent |
| Image Quality | Good | Excellent |
Use Cases #
Display Model Selector #
async function displayModelOptions() {
const response = await fetch('https://api.nelliewriter.com/v1/models');
const { data } = await response.json();
const container = document.getElementById('model-options');
data.forEach(model => {
const card = document.createElement('div');
card.innerHTML = `
${model.name} #
${model.description}
${model.cost_per_book} credits
`;
container.appendChild(card);
});
}
Calculate Expected Cost #
import requests
def estimate_cost(model_id: str, include_images: bool = False) -> int:
""Estimate the credit cost for a generation.""
response = requests.get("https://api.nelliewriter.com/v1/models")
models = {m["id"]: m for m in response.json()["data"]}
if model_id not in models:
raise ValueError(f"Unknown model: {model_id}")
base_cost = models[model_id]["cost_per_book"]
# Images add approximately 50% to the cost
if include_images:
base_cost = int(base_cost * 1.5)
return base_cost
# Usage
cost = estimate_cost("3.0", include_images=True)
print(f"Estimated cost: {cost} credits")
Pre-flight Cost Check #
from nellie_api import Nellie
client = Nellie(api_key="nel_...")
# Get user's credits
usage = client.get_usage()
available = 10000 - usage.total_credits_used # Assuming 10 credits
# Get model cost
models = client.get_models()
model_3 = next(m for m in models if m.id == "3.0")
if available >= model_3.cost_per_book:
book = client.books.create(
prompt="A sci-fi epic",
model="3.0"
)
else:
print(f"Insufficient credits. Need {model_3.cost_per_book}, have {available}")
Credit Costs #
The cost_per_book is the base cost.
Related Endpoints #
- POST /v1/book — Use model ID when creating books
- GET /v1/usage — Check your credit balance
- GET /v1/configuration — Get other valid parameters
- Rate Limits & Credits — Understanding the credit system
- FAQ — Common questions about pricing