REST API Documentation
Generate AI images programmatically with simple HTTP requests.
Contents
Authentication
All API requests require an API key. Include it in the Authorization header:
Authorization Header
Authorization: Bearer inl_your_api_key_here
Official SDKs (Recommended)
For the best developer experience, we strongly recommend using our official libraries. They automatically handle authentication, long-polling for generation status, URL slugging, and advanced features like multi-tag filtering.
JavaScript / TypeScript SDK
The official @inliner/js library is a lightweight, zero-dependency client that works natively in Node.js, modern browsers, and edge runtimes.
View the documentation on GitHub.
Python SDK
The official inliner-ai Python library for server-side generation, editing, and asset management. Built on `httpx` for high performance.
View the documentation on GitHub.
Go (Golang) SDK
The official inliner-go client for building high-performance backend infrastructure, CLI tools, and microservices.
Installation
go get github.com/inliner-ai/inliner-go
Basic Usage
import "github.com/inliner-ai/inliner-go/inliner"
client := inliner.NewClient("your_api_key", nil)
// Generate an image
result, err := client.GenerateImage(inliner.GenerateOptions{
Project: "marketing",
Prompt: "a futuristic city",
Width: 1200,
Height: 600,
})
fmt.Println("Image URL:", result.URL)
View the full documentation on GitHub.
PHP SDK
The official inliner/inliner-php library for modern PHP applications. PSR-4 compliant and Composer-ready.
Installation
composer require inliner/inliner-php
Basic Usage
use Inliner\InlinerClient;
$client = new InlinerClient('your_api_key');
// Generate an image
$result = $client->generateImage(
project: 'marketing',
prompt: 'a futuristic city',
width: 1200,
height: 600
);
echo 'Image URL: ' . $result['url'];
View the full documentation on GitHub.
Raw REST API Reference
If you are not using one of our official SDKs, you can interact with the raw HTTP endpoints below. Note that for endpoints like /content/generate, you may need to implement your own polling logic using /content/request-json/.
Generate Image
Generate an AI image from a text description. The image is created on first request and cached globally.
Request an image by describing it in the URL path. Returns JSON with the image URL and status.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
project required |
string | Your project namespace (e.g., mysite) |
description required |
string | Hyphenated image description (e.g., happy-dog-playing) |
width required |
integer | Image width in pixels (e.g., 800) |
height required |
integer | Image height in pixels (e.g., 600) |
format required |
string | File format: png, jpg, or webp |
Example Request
cURL
curl -X GET \ "https://api.inliner.ai/content/request-json/mysite/sunset-over-mountains_1920x1080.png" \ -H "Authorization: Bearer inl_your_api_key"
Response
JSON Response
{
"status": "ready",
"imageUrl": "https://img.inliner.ai/mysite/sunset-over-mountains_1920x1080.png",
"width": 1920,
"height": 1080,
"format": "png"
}
"status": "generating". Poll the endpoint until status is "ready".
Upload Image
Upload an existing image to your project for editing or as a reference.
Upload an image file using multipart/form-data.
Request Body (multipart/form-data)
| Field | Type | Description |
|---|---|---|
file required |
file | The image file to upload (PNG, JPG, WebP) |
project optional |
string | Project namespace to associate the image with |
Example Request
cURL
curl -X POST \ "https://api.inliner.ai/content/upload" \ -H "Authorization: Bearer inl_your_api_key" \ -F "file=@./my-image.png" \ -F "project=mysite"
Response
JSON Response
{
"success": true,
"imageId": "abc123",
"imageUrl": "https://img.inliner.ai/mysite/uploaded-abc123.png"
}
Edit Image
Edit an existing image using AI-powered instructions.
Apply AI edits to an uploaded image based on text instructions.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
imageUrl required |
string | URL of the image to edit (must be an Inliner image or uploaded file) |
instructions required |
string | Natural language editing instructions (e.g., "remove background") |
Example Request
cURL
curl -X POST \
"https://api.inliner.ai/content/edit" \
-H "Authorization: Bearer inl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://img.inliner.ai/mysite/product-photo_800x800.png",
"instructions": "remove background and add soft shadow"
}'
Response
JSON Response
{
"success": true,
"editedImageUrl": "https://img.inliner.ai/mysite/product-photo_800x800_edited_xyz789.png"
}
Recommend URL Slug From Image
Generate clean, URL-safe slug suggestions directly from an existing stored image.
Uses vision analysis of a saved asset to recommend a concise URL slug and alternatives for rename/edit workflows.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
contentId required |
string | The image asset ID from your account |
maxLength optional |
integer | Maximum slug length (default behavior returns concise slugs) |
Example Request
cURL
curl -X POST \
"https://api.inliner.ai/url/recommend-from-content" \
-H "Authorization: Bearer inl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"contentId": "11111111-1111-1111-1111-111111111111",
"maxLength": 64
}'
Response
JSON Response
{
"recommended": "jumping-frogs-rainforest-parachutes",
"suggestions": [
"jumping-frogs-rainforest-parachutes",
"parachuting-frogs-jungle-action",
"frog-action-scene-rainforest"
]
}
Get Image Details (Metadata)
Fetch full metadata for a single asset, including altText, caption, and customMetadata.
Returns account-scoped details for a specific image. Useful for preloading edit forms and metadata QA workflows.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
contentId required |
string | Image asset ID |
Example Request
cURL
curl -X GET \ "https://api.inliner.ai/content/details/11111111-1111-1111-1111-111111111111" \ -H "Authorization: Bearer inl_your_api_key"
Response
JSON Response
{
"contentId": "11111111-1111-1111-1111-111111111111",
"title": "Jumping Frogs with Parachutes",
"caption": "Three frogs jumping over a rainforest pond with colorful parachutes.",
"altText": "Frogs with small parachutes above a jungle pond",
"customMetadata": {
"campaign": "spring-2026",
"owner": "growth"
}
}
List Projects
Get all projects in your account.
Returns a list of all projects associated with your account.
Example Request
cURL
curl -X GET \ "https://api.inliner.ai/account/projects" \ -H "Authorization: Bearer inl_your_api_key"
Response
JSON Response
{
"projects": [
{
"projectId": "abc123",
"name": "mysite",
"displayName": "My Website",
"imageCount": 42,
"createdAt": "2024-01-15T10:30:00Z"
},
{
"projectId": "def456",
"name": "marketing",
"displayName": "Marketing Campaign",
"imageCount": 18,
"createdAt": "2024-02-20T14:15:00Z"
}
]
}
Create Project
Create a new project to organize your images and reserve a namespace.
Creates a new project and reserves the namespace for your account.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
project required |
string | Project namespace (lowercase letters, numbers, hyphens, underscores only) |
displayName required |
string | Human-readable display name (e.g., "My Website") |
description optional |
string | Description of the project |
isDefault optional |
boolean | Set as the default project for your account |
Example Request
cURL
curl -X POST \
"https://api.inliner.ai/account/projects" \
-H "Authorization: Bearer inl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"project": "my-website",
"displayName": "My Website",
"description": "Images for my portfolio site",
"isDefault": true
}'
Response
JSON Response
{
"success": true,
"project": {
"projectId": "xyz789",
"project": "my-website",
"displayName": "My Website",
"description": "Images for my portfolio site",
"isDefault": true,
"createdAt": "2024-03-15T12:00:00Z"
}
}
List Images
Get all images in a project or your entire account.
Returns a paginated list of generated images.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
project optional |
string | Filter by project namespace |
limit optional |
integer | Number of results (default: 20, max: 100) |
offset optional |
integer | Pagination offset (default: 0) |
Example Request
cURL
curl -X GET \ "https://api.inliner.ai/content/images?project=mysite&limit=10" \ -H "Authorization: Bearer inl_your_api_key"
Response
JSON Response
{
"images": [
{
"imageId": "img123",
"url": "https://img.inliner.ai/mysite/hero-banner_1920x1080.png",
"description": "hero-banner",
"width": 1920,
"height": 1080,
"format": "png",
"createdAt": "2024-03-01T09:00:00Z"
}
],
"total": 42,
"limit": 10,
"offset": 0
}
Check Usage
Get your current plan usage and remaining credits.
Returns your current billing period usage and plan limits.
Example Request
cURL
curl -X GET \ "https://api.inliner.ai/account/plan-usage" \ -H "Authorization: Bearer inl_your_api_key"
Response
JSON Response
{
"plan": "Pro",
"billingPeriod": {
"start": "2024-03-01T00:00:00Z",
"end": "2024-03-31T23:59:59Z"
},
"usage": {
"imagesGenerated": 847,
"imagesLimit": 1200,
"remaining": 353
}
}
Error Responses
The API uses standard HTTP status codes. Error responses include a message explaining what went wrong.
| Status | Meaning |
|---|---|
400 |
Bad Request — Invalid parameters or malformed request |
401 |
Unauthorized — Missing or invalid API key |
403 |
Forbidden — Valid key but insufficient permissions |
404 |
Not Found — Resource doesn't exist |
429 |
Too Many Requests — Rate limit exceeded |
500 |
Internal Server Error — Something went wrong on our end |
Error Response Example
{
"error": "InvalidApiKey",
"message": "The provided API key is invalid or has been revoked.",
"status": 401
}
Rate Limits
API requests are rate-limited based on your plan:
| Plan | Requests/Minute | Concurrent Generations |
|---|---|---|
| Free | 30 | 1 |
| Basic | 60 | 3 |
| Standard | 120 | 5 |
| Pro | 300 | 10 |
Rate limit headers are included in all responses:
X-RateLimit-Limit— Your rate limitX-RateLimit-Remaining— Remaining requests this windowX-RateLimit-Reset— Unix timestamp when the limit resets
Alternative Integration Methods
Prefer a different way to integrate? Check out these options:
- Official JS SDK — Recommended for web and Node.js.
- Official Python SDK — Recommended for Python and server-side apps.
- Official Go SDK — Recommended for high-performance backend infrastructure.
- Official PHP SDK — Recommended for modern PHP and Laravel apps.
- CLI Tool — Generate and edit images from your terminal with
npx @inliner/cli - MCP Server — Live image generation for Claude Code, Cursor, GitHub Copilot, and Gemini CLI
- LLM Integration — Documentation for AI assistants