API Reference
API Endpoints
Complete reference for all Titlize API endpoints.
This document provides a complete reference for all Titlize API endpoints.
Base URL#
All API endpoints are accessed from:
https://api.titlize.comGenerate Image#
Generate a new Open Graph image with text overlay.
Endpoint#
POST /generateContent Type#
Requests must use multipart/form-data encoding.
Request Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
image | File | Yes | Background image (JPEG, PNG, WebP). Max 10MB. |
title | String | Yes | Main title text (1–200 characters) |
subtitle | String | No | Optional subtitle text (1–200 characters) |
position | String | No | Text position: top, center, bottom or custom {"x":N,"y":N}. Ignored when template is set. |
template | String | No | Layout preset: bottom-left (default), left, right, split. Controls text placement, alignment, and gradient direction. |
colorMode | String | No | Text color mode: auto (default), white, black, custom. |
colorHex | String | No | Hex color (e.g., #FF5733). Required when colorMode is custom. |
gradient | Boolean | No | Enable gradient overlay (default: true). Gradient color adapts to image tones. |
textShadow | Boolean | No | Enable text shadow (default: true). Subtle shadow for readability. |
fontSize | Number | No | Manual title font size (24–120). Leave unset for automatic sizing (recommended). |
font | JSON | No | Font selection: {"system":"inter"}. See font list below. Default: arial. |
aspect | String | No | Output aspect ratio: og (1200×630, default), square (1080×1080), portrait (1080×1350). |
fileFormat | String | No | Output encoding: png (default, lossless), jpeg (smaller, lossy), webp (smallest). |
Fonts:
arial (default), inter, montserrat, playfair-display, oswald, lora, raleway, roboto, source-sans-pro
Templates:
bottom-left— Text left-aligned at bottom, above X's overlay safe zone. Bottom-up gradient.left— Text on the left 45% of image, vertically centered. Left-to-right gradient. Use when subject is on the right.right— Text on the right 45%, right-aligned. Right-to-left gradient. Use when subject is on the left.split— Title on the left 30%, subtitle on the right 30%. Dual-edge gradient. Use when subject is centered.
Aspect ratios:
aspect | Dimensions | Use case |
|---|---|---|
og (default) | 1200 × 630 | Open Graph image — auto-embedded in HTML meta tags. |
square | 1080 × 1080 | Manually-posted share image for X feed and Instagram feed. |
portrait | 1080 × 1350 | Manually-posted share image for Instagram feed and stories. |
The og aspect reserves the bottom 28% of the canvas for X's mobile-card overlay; square and portrait use only a 5% aesthetic margin. All four templates work at every aspect.
File formats:
png is lossless and preserves transparency. jpeg and webp use a fixed quality of 85 and produce visibly smaller files for photographic backgrounds (~40% smaller for jpeg). jpeg does not support transparency.
Precedence: When both template and position are provided, template takes precedence and position is ignored.
Example Request#
1 curl -X POST https://api.titlize.com/generate \ 2 -H "Authorization: Bearer your_api_token" \ 3 -F "[email protected]" \ 4 -F "title=10 Tips for Better Writing" \ 5 -F "subtitle=A comprehensive guide" \ 6 -F "template=bottom-left"
Square JPEG share image:
1 curl -X POST https://api.titlize.com/generate \ 2 -H "Authorization: Bearer your_api_token" \ 3 -F "[email protected]" \ 4 -F "title=Five Ways to Improve Your Code" \ 5 -F "aspect=square" \ 6 -F "fileFormat=jpeg"
Portrait WebP for Instagram stories:
1 curl -X POST https://api.titlize.com/generate \ 2 -H "Authorization: Bearer your_api_token" \ 3 -F "[email protected]" \ 4 -F "title=The Complete Guide" \ 5 -F "template=left" \ 6 -F "aspect=portrait" \ 7 -F "fileFormat=webp"
Response#
1 { 2 "success": true, 3 "data": { 4 "id": "gen_abc123def456", 5 "url": "https://<your-image-url>/gen_abc123def456.png", 6 "thumbnailUrl": "https://<your-image-url>/thumbnails/gen_abc123def456.png", 7 "width": 1200, 8 "height": 630, 9 "createdAt": "2024-01-15T10:30:00Z" 10 } 11 }
Error Responses#
400 Bad Request - Invalid parameters
1 { 2 "success": false, 3 "error": { 4 "code": "VALIDATION_ERROR", 5 "message": "Title is required", 6 "details": { 7 "field": "title", 8 "constraint": "required" 9 } 10 } 11 }
413 Payload Too Large - Image exceeds size limit
1 { 2 "success": false, 3 "error": { 4 "code": "FILE_TOO_LARGE", 5 "message": "Image must be less than 10MB" 6 } 7 }
List Images#
Retrieve a list of generated images.
Endpoint#
GET /imagesQuery Parameters#
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | Number | 20 | Results per page (1-100) |
offset | Number | 0 | Number of results to skip |
sort | String | createdAt | Sort field: createdAt, title |
order | String | desc | Sort order: asc, desc |
Example Request#
1 curl -X GET "https://api.titlize.com/images?limit=10&offset=0" \ 2 -H "Authorization: Bearer your_api_token"
Response#
1 { 2 "success": true, 3 "data": { 4 "images": [ 5 { 6 "id": "gen_abc123def456", 7 "title": "10 Tips for Better Writing", 8 "url": "https://<your-image-url>/gen_abc123def456.png", 9 "thumbnailUrl": "https://<your-image-url>/thumbnails/gen_abc123def456.png", 10 "createdAt": "2024-01-15T10:30:00Z" 11 } 12 ], 13 "pagination": { 14 "total": 42, 15 "limit": 10, 16 "offset": 0, 17 "hasMore": true 18 } 19 } 20 }
Get Usage#
Retrieve current usage statistics.
Endpoint#
GET /usageExample Request#
1 curl -X GET https://api.titlize.com/usage \ 2 -H "Authorization: Bearer your_api_token"
Response#
1 { 2 "success": true, 3 "data": { 4 "period": { 5 "start": "2024-01-01T00:00:00Z", 6 "end": "2024-01-31T23:59:59Z" 7 }, 8 "usage": { 9 "generated": 156, 10 "limit": 500, 11 "remaining": 344, 12 "percentUsed": 31.2 13 }, 14 "tier": "pro" 15 } 16 }
Create Token#
Create a new API token.
Endpoint#
POST /tokensRequest Body#
1 { 2 "name": "Production Website" 3 }
Response#
1 { 2 "success": true, 3 "data": { 4 "id": "tok_xyz789", 5 "name": "Production Website", 6 "token": "it_live_abc123...", 7 "createdAt": "2024-01-15T10:30:00Z" 8 } 9 }
Note: The full token is only returned once at creation time.
List Tokens#
List all API tokens for the authenticated user.
Endpoint#
GET /tokensResponse#
1 { 2 "success": true, 3 "data": { 4 "tokens": [ 5 { 6 "id": "tok_xyz789", 7 "name": "Production Website", 8 "lastUsedAt": "2024-01-15T14:22:00Z", 9 "createdAt": "2024-01-01T10:00:00Z" 10 } 11 ] 12 } 13 }
Delete Token#
Revoke an API token.
Endpoint#
DELETE /tokens/:idResponse#
1 { 2 "success": true, 3 "message": "Token deleted successfully" 4 }
Validate Token#
Validate an API token and return the authenticated user's profile and current usage. Useful for integrations (such as the WordPress plugin) that need to confirm a token works and read the account's tier and remaining quota.
Endpoint#
GET /tokens/validateAuthenticate with the API token itself (Authorization: Bearer <token>).
Example Request#
1 curl -X GET https://api.titlize.com/tokens/validate \ 2 -H "Authorization: Bearer your_api_token"
Response#
1 { 2 "success": true, 3 "data": { 4 "user": { 5 "id": "usr_abc123", 6 "email": "[email protected]", 7 "displayName": "Your Name", 8 "tier": "pro" 9 }, 10 "usage": { 11 "month": "2024-01", 12 "quota": 500, 13 "count": 156, 14 "remaining": 344 15 } 16 } 17 }
An invalid or revoked token returns 401 Unauthorized.
HTTP Status Codes#
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing token |
413 | Payload Too Large - File size exceeded |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Requests for a resource that does not exist (for example, fetching an image ID that was never generated) return a not-found error.
Next Steps#
- Use Titlize from an AI assistant with the Assistant Connector (MCP)
- Set up the WordPress Integration
- Review Authentication best practices