Edit images with GPT Image 1.5 via pay-per-call micropayments — no API key required.
What it does
This endpoint provides image editing using OpenAI's GPT Image 1.5 model through StableStudio's micropayment infrastructure. You POST a prompt along with one or more reference image URLs (previously uploaded via StableStudio's file upload flow), and the service returns a job ID. You then poll for the completed result, which contains the edited image URL.
The edit endpoint accepts parameters for prompt, quality (low/medium/high), output size (1024x1024, 1536x1024, 1024x1536, or auto), input fidelity (high/low to control how closely the output matches the source images), background transparency, output format (png/jpeg/webp), compression level, and content moderation strictness. Pricing is dynamic, ranging from $0.009 to $0.20 per generation depending on quality and size settings. Typical latency is around 3 seconds.
Payment is handled via the MPP protocol (Tempo method with pathUSD on Tempo L2) or x402 (USDC on Base, network eip155:8453). The flow is: POST without payment to receive a 402 challenge, sign the USDC authorization, re-POST with the PAYMENT-SIGNATURE header, then poll GET /api/jobs/{jobId} with a SIGN-IN-WITH-X wallet signature header until the job completes. Images for editing must first be uploaded through the /api/upload flow ($0.01 per upload) to obtain blob URLs. No API keys or subscriptions are needed — authentication and payment are entirely wallet-based.
Capabilities
Use cases
- —Editing product photos by describing desired changes in natural language
- —Applying style transfers or modifications to existing images using reference inputs
- —Removing or replacing backgrounds with transparent or opaque options
- —Batch image editing workflows driven by AI agents with per-call payment
- —Adjusting image fidelity and quality for different output requirements
Fit
Best for
- —AI agents needing pay-per-call image editing without API key management
- —Developers wanting GPT Image 1.5 editing via crypto micropayments
- —Workflows requiring transparent background or multi-format output from edits
Not for
- —High-volume batch processing where subscription pricing would be cheaper
- —Use cases requiring real-time sub-second responses (async job polling adds latency)
- —Users without a crypto wallet (USDC on Base or pathUSD on Tempo required)
Quick start
# 1. POST without payment to get 402 challenge
curl -X POST https://stablestudio.dev/api/generate/gpt-image-1.5/edit \
-H 'Content-Type: application/json' \
-d '{"prompt": "Make the background a sunset", "images": ["https://your-blob-url..."], "quality": "high", "size": "1024x1024"}'Example
Request
{
"size": "1024x1024",
"images": [
"https://example.blob.vercel-storage.com/uploads/abc/photo.png"
],
"prompt": "Make the background a sunset over the ocean",
"quality": "high",
"background": "opaque",
"moderation": "low",
"output_format": "png",
"input_fidelity": "high"
}Response
{
"type": "gpt-image-1.5-edit",
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"success": true
}Endpoint
Quality
Full OpenAPI schema with detailed input/output definitions, clear pricing documentation, well-documented payment flow, and comprehensive guidance. The endpoint returned 405 on HEAD/GET probes (expected since it's POST-only), so liveness is inferred from the broader platform being live (root returns 200) and the complete OpenAPI spec. Deducted slightly because no direct 402 challenge was captured for this specific endpoint.
Warnings
- —Probe returned 405 on HEAD/GET — endpoint is POST-only, so no direct 402 challenge was captured; liveness inferred from platform context
- —Images must be pre-uploaded via the /api/upload flow ($0.01 per upload) before they can be used in edit requests
- —Requires a crypto wallet with USDC on Base or pathUSD on Tempo for payment
Citations
- —GPT Image 1.5 edit costs $0.009–$0.20 per generation with ~3s latencyhttps://stablestudio.dev
- —Edit endpoint accepts prompt, quality, size, input_fidelity, images, background, output_format, output_compression, moderation parametershttps://stablestudio.dev
- —Payment settles via USDC on Base (eip155:8453) or Tempo method with pathUSDhttps://stablestudio.dev
- —File upload flow costs $0.01 per upload and uses Vercel Blob storagehttps://stablestudio.dev
- —Job polling uses SIGN-IN-WITH-X wallet signature authenticationhttps://stablestudio.dev