Back to API Access

Sermon Generator API

Generate complete sermons based on Scripture passages, topics, or themes

Endpoint
POST /api/sermon/generate
Authentication

Requires API key in Authorization header: `Bearer YOUR_API_KEY`

Authorization: Bearer YOUR_API_KEY
Request Parameters
passagestring (required)

Bible passage reference

Example: John 3:16
durationnumber (required)

Sermon length in minutes (15, 30, 45, 60)

Example: 30
stylestring (optional)

Sermon style

Example: expository
Options: expository, topical, narrative, thematic
audiencestring (optional)

Target audience

Example: general
Options: general, youth, children, scholars
includeIllustrationsboolean (optional)

Include stories and examples

Example: true
includeApplicationboolean (optional)

Include practical applications

Example: true
personalAnecdotesstring (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 parameters
401Unauthorized - invalid API key
429Rate limit exceeded
500Internal server error

Best 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