Stability AI API playground
This tool calls the Stability AI Stable Image API directly from your browser with your own key, so you can compare Stable Image Core, SD3, and Stable Image Ultra on the same prompt without writing code. Set the aspect ratio, an optional negative prompt, and a style preset, see the credit cost for your chosen model, and generate inline.
How the browser talks to the API
On generate, the playground POSTs a multipart/form-data request to the
appropriate Stable Image endpoint (for example
https://api.stability.ai/v2beta/stable-image/generate/core) with an
Authorization header carrying your key and accept: image/* so the API returns
the image bytes. The browser turns those bytes into an object URL and shows the
result. There is no backend, nothing is stored, and your API key is only sent
directly to Stability’s own API.
Model comparison
| Model | Speed | Credit cost | Best for |
|---|---|---|---|
| Stable Image Core | Fast | Lowest | Rapid iteration, drafting, exploring prompts |
| SD3 (Stable Diffusion 3) | Medium | Medium | High-quality final images, text rendering |
| Stable Image Ultra | Slower | Highest | Production-quality output, photorealism |
SD3 added significant improvements to text rendering within images — if your prompt needs legible words or numbers in the image, SD3 is the right choice. Core ignores the negative_prompt field, so negative prompt effects are most reliable on SD3 and Ultra.
Workflow: iterate cheap, render once
A common workflow when using the API:
- Draft on Core with the same prompt until the composition and subject read correctly. Core generates quickly and costs far fewer credits per attempt.
- Refine the prompt based on what Core shows you — add or remove descriptors, adjust style language.
- Final render on SD3 or Ultra once the prompt is dialled in. You spend the higher-credit render on a prompt you are already confident in, avoiding costly misfires.
This pattern typically produces better results than going straight to Ultra and is meaningfully cheaper.
Prompt and parameter guidance
Aspect ratios: choose a ratio that matches the intended output — 1:1 for avatars and social posts, 16:9 for banners and wallpapers, 2:3 for portrait/mobile. The API does not freely allow arbitrary resolutions; aspect ratios map to fixed supported dimensions.
Style presets: Stability provides presets like photographic, anime, digital-art, cinematic, 3d-model, and neon-punk. These act as a style layer on top of your prompt and can dramatically change the aesthetic without lengthening the prompt. Combine with a clear subject prompt rather than using a preset as a substitute for specificity.
Negative prompts: list what you want to avoid — blurry, watermark, extra limbs, text, low quality. Long negative prompts with many terms give the model more to avoid, but very long negatives can start to affect the positive composition. Keep it to the 5–10 most important exclusions.
Troubleshooting errors
| Error | Likely cause |
|---|---|
| 401 Unauthorized | API key is missing or invalid |
| 403 Forbidden | Out of credits, or key lacks access to that endpoint |
| 413 / content policy | Prompt matched a content filter |
| Network error | CORS issue if running from a local file (use a server) |
Check your credit balance at platform.stability.ai before assuming a 403 is a prompt rejection — in practice, exhausted credits are the more common cause.
Key safety and why this runs client-side
Because the request goes straight from your browser to api.stability.ai, your key
never touches a Gera server — but that also means the key is visible in your browser’s
network tab while you use the tool. Two practical consequences:
- Use a scoped or low-limit key for experimentation. If you routinely test in a browser, generate a separate key you can revoke without disrupting production.
- Never embed a key in a public web page. This playground is a personal testing surface; a real product must proxy Stability calls through a backend so the key stays server-side. The browser-direct pattern is convenient for a playground precisely because it is not how you should ship.
Reading the credit cost preview
The cost shown before you generate reflects Stability’s per-model credit pricing at the time of the request. Because Stability adjusts model availability and pricing over time, treat the preview as an estimate and confirm current rates on the Stability platform. The relative ordering — Core cheapest, Ultra dearest — has been stable, which is what makes the “draft on Core, render on Ultra” workflow reliably economical.
Keep your key safe while you experiment
One operational note worth repeating: treat the API key you paste here like a password. Scope a separate key for experimentation, set a spending cap on the account if the platform offers one, and rotate the key after sharing a screen or recording a demo — image-generation credits are a favourite target for leaked-key abuse precisely because usage is easy to monetise and hard to trace. This playground keeps the key in your browser only and sends it directly to Stability’s endpoint; it is never transmitted to this site’s servers or stored between sessions.
Sources
- Stability AI — Stable Image Generate API reference — endpoints, parameters and credit costs.
- Stability AI — Platform credits and pricing — current per-model credit rates.