HomeAPI Documentation

API Reference

v1.1.0 — REST API for AI agents and integrations

Authentication

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer sk_live_your_api_key_here

Generate API keys from the Studio dashboard or via the POST /api/keys endpoint.

Key Types

API Key

sk_live_...

For REST API access. Use from your backend, scripts, or AI agent workflows. Full access to all generation and export endpoints.

MCP Token

mcp_live_...

For MCP server connections. Pass as INFINIXUI_API_KEY env var when running the MCP server.

Scopes available:

  • carousel:generate — Create and export carousels
  • ebook:generate — Create ebooks
  • config:read — List templates, themes, formats
  • files:read — List generated files

Rate Limits

PlanRequests/minGenerations/day
Free1050
Pro60500
EnterpriseUnlimitedUnlimited

Endpoints

GET/api/configconfig:read

List Configuration

Returns all available templates, themes, formats, designs, and modes. Use this to discover what options are available before generating content.

Request

curl -X GET https://infinixui.dev/api/config \
  -H "Authorization: Bearer sk_live_..."

Response

{
  "success": true,
  "version": "1.1.0",
  "modes": [
    { "value": "carousel", "label": "Carrousel" },
    { "value": "ebook", "label": "Ebook" }
  ],
  "templates": [...],
  "designs": [...],
  "formats": [...],
  "ebookTemplates": [...],
  "ebookThemes": [...]
}
POST/api/ebook/generateebook:generate

Generate Ebook

Create an ebook layout from structured chapter data. Returns a studio URL to view, edit, and export the ebook as PDF.

Request

curl -X POST https://infinixui.dev/api/ebook/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "guide-pratique",
    "theme": "stripe",
    "title": "The Complete Guide to AI",
    "subtitle": "Everything you need to know",
    "author": "John Smith",
    "chapters": [
      {
        "title": "Introduction to AI",
        "hook": "AI is transforming...",
        "sections": [
          {
            "title": "What is AI?",
            "content": ["Paragraph 1...", "Paragraph 2..."]
          }
        ],
        "summary": ["Key point 1", "Key point 2"],
        "tip": "Start with simple models"
      }
    ],
    "introduction": { "body": "Welcome to this guide..." },
    "conclusion": { "body": "In summary...", "summary": "..." }
  }'

Response

{
  "success": true,
  "id": "ebook_1709312345_x7y8z9",
  "studioUrl": "https://infinixui.dev/ebook/guide-pratique?session=...",
  "templateId": "guide-pratique",
  "theme": "stripe",
  "title": "The Complete Guide to AI",
  "chaptersCount": 1
}
POST/api/carousel/export-pdfcarousel:generate

Export Carousel PDF

Export a previously generated carousel as a high-quality PDF. Requires the session ID from generate.

Request

curl -X POST https://infinixui.dev/api/carousel/export-pdf \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "sessionId": "carousel_1709312345_a1b2c3" }'

Response

{
  "success": true,
  "pdfUrl": "/generated/carousel_1709312345_a1b2c3.pdf"
}
GET/api/filesfiles:read

List Generated Files

List all previously generated carousels and ebooks.

Request

curl -X GET https://infinixui.dev/api/files \
  -H "Authorization: Bearer sk_live_..."

Response

{
  "success": true,
  "records": [
    {
      "id": "carousel_...",
      "mode": "carousel",
      "title": "5 Tips for Better UX",
      "createdAt": "2025-03-09T..."
    },
    {
      "id": "ebook_...",
      "mode": "ebook",
      "title": "The Complete Guide to AI",
      "createdAt": "2025-03-09T..."
    }
  ]
}
POST/api/keys

Create API Key

Generate a new API key or MCP access token. Requires JWT authentication.

Request

curl -X POST https://infinixui.dev/api/keys \
  -H "Authorization: Bearer <jwt_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Agent Key",
    "keyType": "api",
    "scopes": ["carousel:generate", "ebook:generate", "config:read"]
  }'

Response

{
  "success": true,
  "key": {
    "id": "uuid-...",
    "name": "My Agent Key",
    "key_prefix": "sk_live_a1b2c3d4",
    "key_type": "api",
    "scopes": ["carousel:generate", "ebook:generate", "config:read"],
    "rawKey": "sk_live_a1b2c3d4e5f6..."
  },
  "message": "Save your API key now. You will not be able to see it again."
}
GET/api/keys

List API Keys

List all API keys for the authenticated user. Key secrets are never shown.

Request

curl -X GET https://infinixui.dev/api/keys \
  -H "Authorization: Bearer <jwt_token>"

Response

{
  "success": true,
  "keys": [
    {
      "id": "uuid-...",
      "name": "My Agent Key",
      "key_prefix": "sk_live_a1b2...",
      "key_type": "api",
      "scopes": ["carousel:generate", "ebook:generate"],
      "last_used_at": "2025-03-09T...",
      "revoked": false,
      "created_at": "2025-03-08T..."
    }
  ]
}
DELETE/api/keys?id={keyId}

Revoke API Key

Revoke an API key by its ID. The key will immediately stop working.

Request

curl -X DELETE "https://infinixui.dev/api/keys?id=uuid-..." \
  -H "Authorization: Bearer <jwt_token>"

Response

{
  "success": true,
  "message": "Key revoked."
}

Error Codes

CodeMeaningAction
401Invalid or missing API keyCheck your Bearer token
403Insufficient scopeCreate a key with the required scope
429Rate limit exceededWait and retry, or upgrade plan
500Internal errorRetry or contact support