Back to API Access
Sermon Generator API
Generate complete sermons based on Scripture passages, topics, or themes
Endpoint
POST /api/sermon/generateAuthentication
Requires API key in Authorization header: `Bearer YOUR_API_KEY`
Authorization: Bearer YOUR_API_KEYRequest Parameters
passagestring (required)Bible passage reference
Example:
John 3:16durationnumber (required)Sermon length in minutes (15, 30, 45, 60)
Example:
30stylestring (optional)Sermon style
Example:
expositoryOptions:
expository, topical, narrative, thematicaudiencestring (optional)Target audience
Example:
generalOptions:
general, youth, children, scholarsincludeIllustrationsboolean (optional)Include stories and examples
Example:
trueincludeApplicationboolean (optional)Include practical applications
Example:
truepersonalAnecdotesstring (optional)Personal stories to weave into the sermon
Example:
A time when I struggled with forgiveness...Response Format
{
"success": true,
"sermon": {
"passage": "John 3:16",
"duration": "30",
"style": "expository",
"audience": "general",
"content": "Complete sermon text...",
"mainPoint": "God's love is demonstrated through the gift of His Son",
"targetWordCount": 4500,
"actualWordCount": 4523
}
}Code Examples
async function generateSermon() {
const response = await fetch('/api/sermon/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
passage: 'John 3:16',
duration: 30,
style: 'expository',
audience: 'general',
includeIllustrations: true,
includeApplication: true
})
});
const result = await response.json();
return result.sermon;
}Rate Limits & Error Codes
Rate Limits
Free tier: 50 requests/day | Basic: 500/day | Professional: 5,000/day
Error Codes
400Invalid request parameters401Unauthorized - invalid API key429Rate limit exceeded500Internal server errorBest Practices
- • Always validate passage references before sending
- • Cache responses when possible to reduce API calls
- • Handle rate limit responses gracefully with exponential backoff
- • Review and customize generated content for your specific context
- • Use personal anecdotes parameter to add authentic personal touch