REST API Documentation - Inliner.ai

REST API Documentation

Generate AI images programmatically with simple HTTP requests.

Base URL: https://api.inliner.ai

Authentication

All API requests require an API key. Include it in the Authorization header:

Authorization Header

Authorization: Bearer inl_your_api_key_here
Get an API Key: Log into your account, go to Account → API Keys, and click "Create API Key".

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.

GET /content/request-json/{project}/{description}_{width}x{height}.{format}

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"
}
Note: If the image hasn't been generated yet, the response will include "status": "generating". Poll the endpoint until status is "ready".

Upload Image

Upload an existing image to your project for editing or as a reference.

POST /content/upload

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.

POST /content/edit

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.

POST /url/recommend-from-content

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.

GET /content/details/{contentId}

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.

GET /account/projects

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.

POST /account/projects

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.

GET /content/images

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.

GET /account/plan-usage

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:

Alternative Integration Methods

Prefer a different way to integrate? Check out these options:

Ready to Integrate?

Get your API key and start generating images in minutes