The official Python client for Inliner.ai. Generate, edit, and manage AI images with a simple, modern API.
pip install inliner-aifrom inliner import InlinerClient
# Initialize with your API key
client = InlinerClient(api_key="YOUR_INLINER_API_KEY")
# 1. Generate an Inliner image URL (instant)
url = client.build_image_url("marketing", "happy-team-meeting", 1200, 600, "jpg")
# Result: https://img.inliner.ai/marketing/happy-team-meeting_1200x600.jpg
# 2. Generate a new image (polls until complete)
result = client.generate_image(
project="web",
prompt="a futuristic neon lizard catching a fly",
width=800,
height=600
)
print(f"Generated URL: {result['url']}")
# result['data'] contains the raw image bytes
# 3. Add tags to existing images
client.add_tags(["uuid-abc-123"], ["nature", "wildlife"])
# 4. Search with multi-tag filtering (AND logic)
images = client.search(
expression="tags:nature AND tags:wildlife",
max_results=10
)
for item in images['items']:
print(f"Title: {item['title']}, URL: {item['url']}")High-quality AI image generation with "Smart URL" support for SEO-friendly slugs.
result = client.generate_image(
project="my-site",
prompt="minimalist workspace with a laptop",
format="jpg",
width=1920,
height=1080
)Apply natural language instructions to existing images or local files.
# Edit by Inliner URL
edited = client.edit_image(
source="https://img.inliner.ai/proj/img_800x600.png",
instruction="add a coffee mug on the desk"
)
# Edit local file
with open("photo.png", "rb") as f:
result = client.edit_image(
source=f,
project="my-site",
instruction="remove the background"
)Automatically analyze, tag, and organize your entire library.
# List images with pagination
result = client.list_images(project_id="marketing", page=1, page_size=20)
# Delete images
client.delete_images(["uuid-123", "uuid-456"])
# Rename/Move an image
client.rename_image("uuid-123", "marketing/new-hero-slug")Find assets instantly using the Inliner search expression engine.
# Use complex logical filters
results = client.search(
expression="tags:nature AND tags:mountain AND format:png",
sort_by="created_at",
direction="desc"
)- Python 3.8+
httpx
MIT