API Documentation
Generate beautiful SVG illustrations and PNG images from text prompts using our REST API.
https://api.oomf.inAuthentication
All authenticated endpoints require an API key passed in the X-API-Key header.
curl -H "X-API-Key: your-api-key-here" \
https://api.oomf.in/generateEndpoints
POST /generate
Generate an SVG or PNG illustration from a text prompt.
Request Body
promptrequiredText description of the image (1-500 characters)
formatoptionalOutput format: svg (default) or png
styleoptionalStyle name (e.g., minimalist_line)
filenameoptionalCustom filename without extension (max 100 chars)
Response
{
"task_id": "550e8400-...",
"status": "queued",
"message": "Generation task started..."
}Example Request
curl -X POST https://api.oomf.in/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"prompt": "A cute cat playing with yarn",
"format": "svg",
"style": "minimalist_line"
}'POST /generate-with-images
Generate with optional input images for editing or composition (max 4 images).
Form Data Parameters
promptrequiredText description
images[]optionalInput images (JPEG, PNG, WebP) - max 4
formatoptionalsvg or png (default: svg)
styleoptionalStyle name
Example Request
curl -X POST https://api.oomf.in/generate-with-images \
-H "X-API-Key: your-api-key-here" \
-F "prompt=Change background to beach sunset" \
-F "format=png" \
-F "style=golden_hour_portrait" \
-F "[email protected]"GET /status/{task_id}
Check the status of a generation task.
Response (Completed)
{
"task_id": "550e8400-...",
"status": "completed",
"message": "SVG generated successfully",
"file_path": "/path/to/file.svg",
"download_url": "https://api.oomf.in/download/..."
}Status values: queued, processing, completed, failed
Example Request
curl -H "X-API-Key: your-api-key-here" \
https://api.oomf.in/status/550e8400-e29b-41d4-a716-446655440000GET /download/{task_id}
Download the generated file. No authentication required.
Public endpoint: No API key required. Rate limited by IP address.
Example Request
curl -O https://api.oomf.in/download/550e8400-e29b-41d4-a716-446655440000GET /styles
List all available styles. No authentication required.
Query Parameters
formatoptionalFilter by svg or png
Response
{
"total_styles": 48,
"description": "SVG styles...",
"default_svg_style": "minimalist_line",
"default_png_style": "studio_professional",
"styles": {
"minimalist_line": "Clean lines...",
...
}
}Example Request
curl https://api.oomf.in/styles?format=svgGET /styles/categories
List styles organized by category. No authentication required.
Response Structure
{
"svg_categories": {
"icon_symbol": {
"description": "Icon & Symbol Styles",
"styles": ["minimalist_line", ...]
},
...
},
"png_categories": {
"photorealistic": { ... },
...
}
}Example Request
curl https://api.oomf.in/styles/categoriesMCP Server
Use our API through the Model Context Protocol (MCP) server for seamless integration with Claude Desktop and other MCP-compatible clients.
Installation
npx -y @modelcontextprotocol/create-server oomf-mcp-serverConfiguration
Add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"oomf": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/oomf-mcp-server"],
"env": {
"OOMF_API_KEY": "your-api-key-here"
}
}
}
}Config file locations:
- • macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - • Windows:
%APPDATA%\Claude\claude_desktop_config.json
Available Tools
generate_image
Generate SVG or PNG images from text prompts with optional style selection.
promptrequiredText description of the image to generate
formatoptionalOutput format: svg or png
styleoptionalStyle name from available styles list
list_styles
List all available image styles, optionally filtered by format.
formatoptionalOptional filter: svg or png
get_task_status
Check the status of a generation task and get the download URL when complete.
task_idrequiredThe UUID of the generation task
Usage Example
Once configured, you can ask Claude to generate images directly:
"Generate a minimalist line art SVG of a mountain landscape"
Tip: The MCP server automatically handles task polling and returns the final download URL when the image is ready.
Complete Examples
JavaScript/Node.js
const API_KEY = 'your-api-key-here';
const BASE_URL = 'https://api.oomf.in';
// Generate an image
async function generateImage() {
const response = await fetch(`${BASE_URL}/generate`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
},
body: JSON.stringify({
prompt: 'A mountain landscape at sunset',
format: 'svg',
style: 'minimalist_line'
})
});
const data = await response.json();
console.log('Task ID:', data.task_id);
// Poll for completion
return await pollStatus(data.task_id);
}
// Check status
async function pollStatus(taskId) {
while (true) {
const response = await fetch(`${BASE_URL}/status/${taskId}`, {
headers: { 'X-API-Key': API_KEY }
});
const data = await response.json();
console.log('Status:', data.status);
if (data.status === 'completed') {
console.log('Download URL:', data.download_url);
return data;
} else if (data.status === 'failed') {
throw new Error(data.message);
}
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
generateImage().catch(console.error);Python
import requests
import time
API_KEY = 'your-api-key-here'
BASE_URL = 'https://api.oomf.in'
def generate_image(prompt, style='minimalist_line', format='svg'):
headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
data = {
'prompt': prompt,
'style': style,
'format': format
}
# Start generation
response = requests.post(f'{BASE_URL}/generate',
headers=headers,
json=data)
task_id = response.json()['task_id']
# Poll for completion
while True:
status_response = requests.get(
f'{BASE_URL}/status/{task_id}',
headers=headers
)
status_data = status_response.json()
if status_data['status'] == 'completed':
return status_data['download_url']
elif status_data['status'] == 'failed':
raise Exception(status_data['message'])
time.sleep(2)
# Usage
url = generate_image('A serene forest path', style='watercolor_soft')
print(f'Download: {url}')Error Handling
400 Bad RequestInvalid parameters or request format
403 ForbiddenInvalid or missing API key
404 Not FoundTask ID not found
429 Too Many RequestsRate limit exceeded
Error Response Format
{
"detail": "Invalid API key"
}