Skip to content

Introduction

Welcome to the Splinterpic API documentation. Splinterpic is a production-ready AI image generation platform built on Cloudflare’s edge infrastructure, delivering sub-100ms response times globally.

Splinterpic provides a simple, powerful API for generating AI images using state-of-the-art models like Flux and Stable Diffusion. Built entirely on Cloudflare’s edge network, Splinterpic offers:

  • Global edge deployment - Sub-100ms latency worldwide
  • Enterprise-grade security - IP whitelisting, API key authentication
  • Cloudflare AI models - Access to latest AI models without infrastructure
  • R2 storage - Fast, durable image storage
  • SQLite at the edge - D1 database for metadata and analytics

Generate high-quality AI images from text prompts using multiple model options:

  • Flux 1 Schnell (fast generation)
  • Stable Diffusion XL
  • Custom fine-tuned models
  • Collections - Group images by project or campaign
  • Templates - Save and reuse generation settings
  • Tagging - Categorize and search images efficiently
  • Real-time usage tracking
  • Cost analysis per model
  • Generation history and trends
  • RESTful API design
  • Comprehensive SDKs (JavaScript, Python)
  • Webhook integrations
  • Batch processing support
┌─────────────┐ ┌──────────────────┐ ┌────────────┐
│ Client │─────▶│ Cloudflare Pages │─────▶│ React │
│ │ │ (Static Site) │ │ Dashboard │
└─────────────┘ └──────────────────┘ └────────────┘
┌──────────────────┐
│ Cloudflare Worker│
│ (API Layer) │
└──────────────────┘
┌────────┴────────┐
▼ ▼
┌─────────┐ ┌──────────┐
│ D1 (DB) │ │ R2 (Storage)│
└─────────┘ └──────────┘
┌─────────────┐
│ Cloudflare │
│ AI │
└─────────────┘

Generate your first image with a simple API call:

Terminal window
# cURL Example
curl -X POST https://your-worker.workers.dev/api/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene mountain landscape at sunset",
"model": "@cf/black-forest-labs/flux-1-schnell"
}'
// JavaScript Example
const response = await fetch('https://your-worker.workers.dev/api/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: 'A serene mountain landscape at sunset',
model: '@cf/black-forest-labs/flux-1-schnell'
})
});
const image = await response.json();
console.log(image.r2_url); // Access the generated image
# Python Example
import requests
response = requests.post(
'https://your-worker.workers.dev/api/generate',
json={
'prompt': 'A serene mountain landscape at sunset',
'model': '@cf/black-forest-labs/flux-1-schnell'
}
)
image = response.json()
print(image['r2_url']) # Access the generated image
  • Generate social media assets on-demand
  • Create campaign visuals rapidly
  • A/B test different creative concepts
  • Prototype UI mockups and concepts
  • Generate placeholder images
  • Create feature illustrations
  • Integrate AI image generation into apps
  • Build custom image editing tools
  • Automate content creation pipelines
  • Scale creative output for clients
  • Reduce design iteration time
  • Maintain brand consistency across projects
  • Quick Start - Get up and running in 5 minutes with our quickstart guide
  • Authentication - Learn how to authenticate your API requests securely
  • API Reference - Explore all available endpoints and parameters
  • SDKs - Use our official SDKs for faster integration

Need help? We’re here for you: