Edit images with GPT Image 1 via micropayment — pay per call with USDC on Base, no API key needed.
What it does
This endpoint provides image editing using OpenAI's GPT Image 1 model, accessed through StableStudio's pay-per-generation platform. You POST a prompt and one or more reference image URLs (previously uploaded via StableStudio's file upload flow) and receive an edited image. Payment is handled inline via the MPP protocol: an unauthenticated request returns a 402 challenge with USDC payment requirements on Base (EIP-155:8453), and a signed payment header on the subsequent request triggers the job. The endpoint costs $0.009–$0.20 per edit depending on quality settings.
The request body accepts a text prompt (required), an array of image URLs (required), plus optional parameters for quality (low/medium/high), output size (1024×1024, 1536×1024, 1024×1536, or auto), input fidelity (high/low), background transparency, output format (png/jpeg/webp), compression level, and moderation strictness. The response returns a jobId with status "pending"; you then poll GET /api/jobs/{jobId} with a SIGN-IN-WITH-X wallet signature header until the job completes and returns the output image URL.
Note: The listing URL uses the path segment "gpt-image-1" but the OpenAPI spec and documentation reference the model as "gpt-image-1.5". The actual edit endpoint in the spec is at /api/generate/gpt-image-1.5/edit. The probe did not capture a 402 challenge on this specific endpoint (it returned 405 on HEAD/GET since it only accepts POST), but the OpenAPI spec confirms the route is live and documents the payment flow. Images for editing must first be uploaded through StableStudio's three-step upload flow ($0.01 per upload). Settlement uses USDC on Base or pathUSD on Tempo L2.
Capabilities
Use cases
- —Editing product photos by adding or removing elements via text prompt
- —Applying style transfers or modifications to existing images
- —Removing backgrounds or making them transparent for e-commerce assets
- —Compositing multiple reference images into a new edited output
- —Automated batch image editing in agent workflows without API key management
Fit
Best for
- —Agents needing on-demand image editing with no subscription or API key
- —Workflows requiring transparent background output (PNG with alpha)
- —Low-cost per-image editing at $0.009–$0.20 per call
- —Developers wanting crypto-native pay-per-use image editing
Not for
- —Real-time or sub-second image editing (async job polling adds latency)
- —Users without a crypto wallet (requires USDC on Base or Tempo for payment)
- —Bulk editing thousands of images where subscription pricing would be cheaper
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": "Remove the background", "images": ["https://your-blob-url.vercel-storage.com/img.png"]}'
# Returns 402 with PAYMENT-REQUIRED header (base64 JSON)
# 2. Decode challenge, sign USDC payment, re-POST with PAYMENT-SIGNATURE header
# 3. Poll GET /api/jobs/{jobId} with SIGN-IN-WITH-X header until completeExample
Request
{
"size": "1024x1024",
"images": [
"https://example.blob.vercel-storage.com/uploads/abc/photo.png"
],
"prompt": "Remove the background and make it transparent",
"quality": "high",
"background": "transparent",
"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, comprehensive guidance docs, and clear pricing. The probe returned 405 (not 402) because HEAD/GET were used on a POST-only endpoint, so the endpoint is not confirmed broken — just not probed with the correct method. The listing URL path says 'gpt-image-1' but the spec says 'gpt-image-1.5', creating a minor naming ambiguity.
Warnings
- —Probe returned 405 because HEAD/GET were used; this POST-only endpoint was not probed with the correct HTTP method
- —Listing URL uses path 'gpt-image-1/edit' but the OpenAPI spec defines the route as 'gpt-image-1.5/edit' — verify the correct path
- —Images must be pre-uploaded via the paid upload flow ($0.01) before they can be used in edit requests
- —Requires a crypto wallet with USDC on Base (or pathUSD on Tempo) — no fiat payment option documented
Citations
- —GPT Image 1.5 edit costs $0.009–$0.20 per callhttps://stablestudio.dev
- —Edit endpoint accepts prompt, images, quality, size, input_fidelity, background, output_format, output_compression, moderation parametershttps://stablestudio.dev
- —Payment uses USDC on Base (eip155:8453) or pathUSD on Tempo L2https://stablestudio.dev
- —File upload costs $0.01 and uses a three-step flow via Vercel Blobhttps://stablestudio.dev
- —Job polling uses SIGN-IN-WITH-X wallet signature authenticationhttps://stablestudio.dev