Authentication

All API requests must be authenticated. ContentJet uses Supabase for authentication. When using the API via the dashboard, authentication is handled automatically via session tokens.

For external API access (if enabled), you must include your session token in the Authorization header: Authorization: Bearer YOUR_TOKEN

Endpoints

1. AI Generation

Generate content using our predefined templates.

Endpoint: POST /api/ai/generate Auth Required: Yes

Request Body:

{
  "templateName": "BLOG_POST",
  "variables": {
    "topic": "AI in Marketing",
    "audience": "Marketing Managers",
    "tone": "professional",
    "keywords": "automated content, AI writing"
  },
  "model": "llama-3.3-70b-versatile"
}

Response:

{
  "content": "Full generated text here...",
  "metadata": {
    "provider": "Groq",
    "model": "llama-3.3-70b-versatile",
    "tokens": {
      "prompt": 150,
      "completion": 850,
      "total": 1000
    },
    "durationMs": 4200
  }
}

2. Content History

Manage your saved generations.

List History

Endpoint: GET /api/content-history Auth Required: Yes Query Parameters:

  • page (number, optional): Page number for pagination (default: 1)
  • limit (number, optional): Number of items per page (default: 10)
  • content_type (string, optional): Filter by content type. Valid values: text

Response:

{
  "data": [...],
  "pagination": {
    "total": 150,
    "page": 1,
    "limit": 10,
    "totalPages": 15
  }
}

Save Entry

Endpoint: POST /api/content-history Auth Required: Yes

Request Body:

{
  "content_type": "text",
  "content_data": {
    "title": "My Generated Content",
    "body": "Full content text here..."
  }
}

Delete Entry

Endpoint: DELETE /api/content-history?id={uuid} Auth Required: Yes


3. Subscriptions

Endpoint: GET /api/subscriptions (Fetch active) Endpoint: POST /api/subscriptions (Create/Upgrade) Auth Required: Yes


Rate Limits

  • Free Users: 5 generations per day.
  • Pro Users: 100 generations per day.
  • Premium Users: 1000 generations per day. Note: Subject to change based on fair use policy.
Was this page helpful?
Edit this page on GitHub