Beta — Agency Tier

API Documentation

Build AI-powered ad generation into your product. RESTful API, JSON responses, straightforward authentication.

Quick Start

Get started in 30 seconds

# Generate an ad with curl
curl -X POST https://zarai.ai/api/generate-ad \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Mike's Plumbing",
    "description": "Emergency plumbing services",
    "category": "services",
    "price": "$99",
    "location": "Denver, CO",
    "tier": "basic"
  }'

API Reference

POST /api/generate-ad

Generate a single Craigslist ad from structured input. Returns CL-compatible HTML.

// Request body
{
  "title": "string",          // Business or listing name
  "description": "string",  // Service/product description
  "category": "string",     // services|for-sale|housing|jobs
  "price": "string",        // Price or "Free Estimate"
  "location": "string",     // City, State
  "tier": "basic|premium|pro" // Generation quality tier
}
// Response
{
  "html": "<div>...generated ad HTML...</div>",
  "preview_id": "abc123"
}
GET /preview/{preview_id}

Retrieve a rendered HTML preview of a generated ad. Returns full HTML page.

POST /api/generate/bulk

Generate multiple ads in a single request. Agency tier only. Max 100 per request.

// Request body
{ "ads": [{ ...ad_data }, { ...ad_data }] }
GET /api/analytics

Get usage analytics for your account. Requires authentication.

POST /api/checkout/pro

Initiate Stripe checkout for Pro tier. Returns checkout URL.

POST /api/checkout/agency

Initiate Stripe checkout for Agency tier. Returns checkout URL.

Auth Endpoints

POST /register

Create a new user account.

{ "username": "string", "email": "string", "password": "string" }
POST /token

Authenticate and receive an access token. Use application/x-www-form-urlencoded.

// Response
{ "access_token": "eyJ...", "token_type": "bearer" }

Usage Tiers

TierDaily LimitBulkAnalyticsPrice
Free / Basic3 ads/day$0
Pro / PremiumUnlimitedBasic$9.99/mo
AgencyUnlimited100/reqFull$29.99/mo

Ready to integrate?

Start with the free tier — upgrade to Agency for API access and bulk generation.

Try It Free → Contact for API Key