API Reference
Base URL: https://glamzn.ai/api/glamzn
Authentication
All requests require an API key passed via the X-API-Key header.
// Example
curl -X GET https://glamzn.ai/api/glamzn/me \
-H "X-API-Key: your_api_key"
Response Format
File conversion endpoints return a JSON object with a base64-encoded file field.
// Success
{
"success": true,
"filename": "document.docx",
"mime_type": "application/...",
"file": "UEsDBBQAAAAI..."
}// Error
{
"success": false,
"error": "Monthly limit reached",
"code": "LIMIT_REACHED",
"usage": 10,
"limit": 10
}Error Codes
| HTTP | Code | Description |
|---|---|---|
| 200 | — | Success |
| 202 | — | Accepted — async job started, poll the status URL |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | NO_PLAN | No active subscription |
| 403 | ACTION_NOT_ALLOWED | Action not included in your plan |
| 422 | VALIDATION_ERROR | Invalid request parameters |
| 422 | GENERATION_FAILED | Generation or conversion failed |
| 429 | LIMIT_REACHED | Monthly usage limit exceeded |
| 500 | INTERNAL_ERROR | Internal server error |
/api/glamzn/me
Returns the authenticated user profile and subscription info.
// Example
curl -X GET https://glamzn.ai/api/glamzn/me \
-H "X-API-Key: your_api_key"/api/glamzn/pdf/to-wordConvert a PDF file to Word (.docx) format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to convert |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/to-word \
-H "X-API-Key: your_api_key" \
-F "file=@document.pdf"/api/glamzn/pdf/to-excelConvert a PDF file to Excel (.xlsx) format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to convert |
| pages | string | Optional | Pages to convert (e.g. "all", "1-3") |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/to-excel \
-H "X-API-Key: your_api_key" \
-F "file=@document.pdf" -F "pages=all"/api/glamzn/pdf/to-imageConvert PDF pages to images (PNG, JPG, WebP).
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file |
| format | string | Optional | png, jpg, webp (default: png) |
| dpi | integer | Optional | Resolution in DPI (default: 150) |
| pages | string | Optional | Pages to convert (e.g. "1-3", "all") |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/to-image \
-H "X-API-Key: your_api_key" \
-F "file=@document.pdf" -F "format=png" -F "dpi=150"/api/glamzn/pdf/to-powerpointConvert a PDF file to PowerPoint (.pptx) format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to convert |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/to-powerpoint \
-H "X-API-Key: your_api_key" -F "file=@document.pdf"/api/glamzn/word/to-pdfConvert a Word document (.docx/.doc) to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (DOCX/DOC) | Required | The Word file to convert |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/word/to-pdf \
-H "X-API-Key: your_api_key" -F "file=@document.docx"/api/glamzn/excel/to-pdfConvert an Excel spreadsheet (.xlsx/.xls) to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (XLSX/XLS) | Required | The Excel file to convert |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/excel/to-pdf \
-H "X-API-Key: your_api_key" -F "file=@spreadsheet.xlsx"/api/glamzn/image/to-pdfConvert one or more images to a single PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| files[] | File[] (images) | Required | Image files to combine into PDF |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/image/to-pdf \
-H "X-API-Key: your_api_key" \
-F "files[]=@page1.png" -F "files[]=@page2.png"/api/glamzn/pdf/compressCompress a PDF to reduce file size.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to compress |
| level | string | Optional | low, medium, high (default: medium) |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/compress \
-H "X-API-Key: your_api_key" \
-F "file=@document.pdf" -F "level=medium"/api/glamzn/pdf/mergeMerge multiple PDF files into one.
| Parameter | Type | Required | Description |
|---|---|---|---|
| files[] | File[] (PDF) | Required | PDF files to merge (in order) |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/merge \
-H "X-API-Key: your_api_key" \
-F "files[]=@doc1.pdf" -F "files[]=@doc2.pdf"/api/glamzn/pdf/splitSplit a PDF into multiple files.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to split |
| ranges | string | Optional | Page ranges (e.g. "1-3,4-6") |
| single_pages | boolean | Optional | Split into individual pages |
// cURL
curl -X POST https://glamzn.ai/api/glamzn/pdf/split \
-H "X-API-Key: your_api_key" \
-F "file=@document.pdf" -F "ranges=1-3,4-6"/api/glamzn/pdf/rotateRotate pages of a PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file |
| rotation | integer | Optional | 90, 180, 270 (default: 90) |
| pages | string | Optional | Pages to rotate (e.g. "1,3,5" or "all") |
/api/glamzn/pdf/watermarkAdd a text watermark to a PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file |
| text | string | Optional | Watermark text (default: "CONFIDENTIAL") |
| opacity | integer | Optional | 0–100 (default: 30) |
| position | string | Optional | center, top-left, top-right, bottom-left, bottom-right |
| rotation | integer | Optional | Rotation angle (default: -45) |
| font_size | integer | Optional | Font size in pt (default: 48) |
| color | string | Optional | Hex color (default: #000000) |
/api/glamzn/pdf/protectPassword-protect a PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file |
| user_password | string | Required | Password to open the document |
| owner_password | string | Optional | Owner password for permissions |
/api/glamzn/pdf/ocrRun OCR on a scanned PDF to make it searchable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The scanned PDF file |
| language | string | Optional | OCR language(s) (e.g. "eng", "fra+eng") |
/api/glamzn/pdf/add-page-numbersAdd page numbers to a PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file |
| position | string | Optional | e.g. "bottom-center" |
| format | string | Optional | e.g. "Page {current}/{total}" |
| font_size | integer | Optional | Font size in pt |
| color | string | Optional | Hex color |
| start_page | integer | Optional | First page to number |
/api/glamzn/pdf/editEdit a PDF: add text, signatures, images, delete pages, rotate, or redact.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | The PDF file to edit |
| text_modifications | JSON | Optional | Array of text additions |
| signatures | JSON | Optional | Array of signatures to add |
| images | JSON | Optional | Array of images to add |
| deleted_pages | JSON | Optional | Array of page indexes to delete |
| rotations | JSON | Optional | Array of page rotations |
| redactions | JSON | Optional | Array of redaction zones |
/api/glamzn/documents/uploadUpload a PDF and automatically start AI analysis. Accepts files up to 32 MB.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File (PDF) | Required | PDF file to upload and analyze (max 32 MB) |
| document_type | string | Optional | Hint for analysis (e.g. "contract", "invoice", "report") |
// 202 Accepted
{
"success": true,
"document_id": 123,
"name": "contract.pdf",
"size": 204800,
"analysis_status": "pending",
"status_url": "/api/glamzn/documents/123/status"
}// 422 Errors
// PDF_LOCKED
{ "success": false, "error_code": "PDF_LOCKED" }
// PAGE_LIMIT_EXCEEDED
{
"success": false,
"error_code": "PAGE_LIMIT_EXCEEDED",
"details": { "page_count": 250, "page_limit": 100 }
}/api/glamzn/documents/{documentId}/statusPoll the analysis status. When analysis_status is completed, the full analysis object is included.
| analysis_status | Meaning |
|---|---|
| pending | Queued, not started yet |
| processing | Analysis in progress — keep polling |
| completed | Done — analysis field contains full results |
| failed | Analysis failed — check error_message |
// Processing
{
"document_id": 123,
"analysis_status": "processing",
"progress_step": "Extracting text",
"progress_step_detail": "Page 12 / 45",
"total_pages": 45,
"analysis": null
}// Completed
{
"document_id": 123,
"analysis_status": "completed",
"total_pages": 45,
"analysis": {
"summary": "...",
"key_points": [...]
}
}/api/glamzn/documents/{documentId}/summaryReturns the AI-generated summary and suggested questions. Questions can be passed directly to the chat endpoint.
// 200 Success
{
"document_id": 36,
"summary": "Ce document est un contrat...",
"suggested_questions": [
"Quelles sont les obligations ?",
"Quelle est la durée du contrat ?"
],
"chat_url": "/api/glamzn/documents/36/chat"
}// 422 Not Ready
{
"success": false,
"code": "ANALYSIS_NOT_READY",
"analysis_status": "processing",
"poll_url": "/api/glamzn/documents/36/status"
}/api/glamzn/documents/{documentId}/chatSend a question to the AI about the analyzed PDF. Conversation history maintained per document — no session ID needed.
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Required | Your question (1–2000 chars) |
| language | string | Optional | Force response language: fr or en |
// 200 OK
{
"success": true,
"answer": "According to section 3...",
"document_id": 36
}// 422 Not Ready
{
"success": false,
"code": "ANALYSIS_NOT_READY",
"analysis_status": "processing"
}/api/glamzn/documents/{documentId}/generateGenerate a structured document (book, report, or flashcard set) from an analyzed PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Required | book | report | flashcard |
| title | string | Required | Title of the generated content (max 255 chars) |
| template | string | Required | Template identifier to use |
| language | string | Required | fr | en |
| audience | string | Required | Target audience description |
| custom_instructions | string | Optional | Additional instructions for the AI (max 2000 chars) |
| flashcard_config | object | Optional | Only for type=flashcard: card_count, difficulty_level, include_explanations, question_types, focus_topics |
/api/glamzn/documents/content/{contentId}/statusPoll the generation status. When status is completed, includes download_url (book/report) or flashcard_data JSON.
// In progress
{
"content_id": 42,
"status": "generating",
"progress": 65,
"current_step": "Writing section 3/5"
}// Completed
{
"content_id": 42,
"status": "completed",
"progress": 100,
"download_url": "/api/glamzn/documents/content/42/download"
}/api/glamzn/documents/content/{contentId}/downloadGet a temporary pre-signed S3 URL (valid 1 hour) to download a completed book or report. Not applicable for flashcards — use the /status endpoint instead.
// Response 200
{
"success": true,
"download_url": "https://s3.amazonaws.com/.../report_42.pdf?X-Amz-Expires=3600&...",
"filename": "Executive_Summary.pdf",
"expires_at": "2025-01-01T11:30:00Z"
}/api/glamzn/documents/{documentId}/analyzeRe-trigger AI analysis without re-uploading. Resets analysis_status to pending and clears the previous summary.
// Response 202
{
"success": true,
"document_id": 36,
"analysis_status": "pending",
"poll_url": "/api/glamzn/documents/36/status",
"message": "Re-analysis started."
}/api/glamzn/documentsList all documents belonging to the authenticated user, ordered by most recent.
// Response
{
"success": true,
"count": 2,
"documents": [{
"id": 123,
"name": "contract.pdf",
"analysis_status": "completed",
"created_at": "2025-01-01T10:00:00Z"
}]
}/api/glamzn/documents/{documentId}Permanently delete a document and its file from storage. This action is irreversible.
// Response
{ "success": true, "message": "Document deleted successfully" }/api/glamzn/studio/text-to-imageGenerate an image from a text prompt using FAL.ai.
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Required | Image description (max 1000 chars) |
| style | string | Required | cinematic, realistic, anime, 3d, abstract… |
| aspect_ratio | string | Required | 16:9, 9:16 or 1:1 |
| model | string | Optional | FAL model ID |
| negative_prompt | string | Optional | Elements to exclude (max 500 chars) |
/api/glamzn/studio/text-to-videoGenerate a short video from a text prompt.
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Required | Video description (max 500 chars) |
| style | string | Required | cinematic, realistic, anime, 3d, abstract, vintage… |
| duration | string | Required | 5, 10 or 15 (seconds) |
| aspect_ratio | string | Required | 16:9, 9:16 or 1:1 |
| quality | string | Required | 720p or 1080p |
| negative_prompt | string | Optional | Elements to avoid (max 500 chars) |
| image_0, image_1 | File (image) | Optional | Reference images (max 10 MB each) |
/api/glamzn/studio/film-makerGenerate a cinematic film from a script or prompt.
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt / script | string | Required | Film script or creative brief |
// Response 202
{
"success": true,
"job_id": "vmax_abc123",
"poll_url": "/api/glamzn/studio/film-maker/status/vmax_abc123",
"status": "queued"
}/api/glamzn/studio/film-maker/status/{jobId}// In progress
{ "status": "processing", "progress": 45 }// Completed
{
"status": "completed",
"video_url": "https://s3.amazonaws.com/..."
}/api/glamzn/studio/long-to-shortsConvert a long video (YouTube URL or direct upload) into short-form clips.
| Parameter | Type | Required | Description |
|---|---|---|---|
| video_url | string | One of | YouTube, S3 or direct video URL |
| video_file | File (mp4/mov) | One of | Video file upload (max 500 MB) |
| aspect_ratio | string | Optional | 9:16, 1:1 or 16:9 (default: 9:16) |
| crop_strategy | string | Optional | fit, smart_crop or center (default: fit) |
| generate_subtitles | boolean | Optional | Add auto-generated subtitles (default: true) |
| subtitle_language | string | Optional | fr or en (default: fr) |
| add_summary_text | boolean | Optional | Overlay summary text (default: true) |
| add_part_numbering | boolean | Optional | Show "Part X/Y" overlay (default: true) |
/api/glamzn/studio/long-to-shorts/status/{jobId}// In progress
{
"status": "processing", "progress": 60,
"current_step": "Generating subtitles"
}// Completed
{
"status": "completed", "shorts_count": 4,
"shorts": [{ "id": 1, "video_url": "...", "duration": 58 }]
}/api/glamzn/studio/generate-threadGenerate a Twitter/X thread or LinkedIn post from a topic.
| Parameter | Type | Required | Description |
|---|---|---|---|
| platform | string | Required | twitter or linkedin |
| topic | string | Required | Subject of the thread (10–1000 chars) |
| tone | string | Required | informative, engaging, storytelling, educational, controversial, humorous, professional, inspirational |
| include_hook | boolean | Required | Add a strong opening hook |
| include_cta | boolean | Required | Add a call-to-action at the end |
| include_hashtags | boolean | Required | Add relevant hashtags |
| posts_count | integer | Optional | Number of tweets (1–5, Twitter only, default: 3) |
| use_web_search | boolean | Optional | Enrich with live web data (default: false) |
/api/glamzn/studio/thumbnail-generatorGenerate a high-impact thumbnail using FAL.ai. Optionally insert up to 2 face images.
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | Required | Video or content title (max 100 chars) |
| description | string | Required | Visual description of the thumbnail (max 300 chars) |
| style | string | Required | youtube, gaming, vlog, tutorial, podcast, news, cinematic, minimalist, retro, neon, comic, corporate |
| face_image_0 | File (image) | Optional | First face reference photo (max 5 MB) |
| face_image_1 | File (image) | Optional | Second face reference photo (max 5 MB) |
// Response
{
"success": true,
"url": "https://s3.amazonaws.com/.../thumbnail_42.png",
"media_id": 87,
"message": "Thumbnail generated successfully"
}