endpoint URL for the Stability API
- User
endpoint URL for the Stability API
- Assistant
endpoint URL for the Stability API
The Stability AI API provides access to various generative models, including Stable Diffusion for text-to-image generation. Below are the primary endpoint URLs you can use, depending on the specific service you intend to access:
https://api.stability.ai
To generate images from text prompts using a specific engine (e.g., Stable Diffusion), use the following endpoint:
POST https://api.stability.ai/v1/generation/{engine_id}/text-to-image
Parameters:
{engine_id}: Replace this with the ID of the engine you wish to use. Common engine IDs include:
stable-diffusion-v1: For Stable Diffusion version 1stable-diffusion-v2: For Stable Diffusion version 2POST https://api.stability.ai/v1/generation/stable-diffusion-v1/text-to-image
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"prompt": "A futuristic cityscape at sunset",
"width": 512,
"height": 512,
"samples": 1,
"num_inference_steps": 50
}
All requests to the Stability AI API require an API key. You must include your API key in the Authorization header as a Bearer token.
Header Example:
Authorization: Bearer YOUR_API_KEY
Stability AI may offer additional endpoints for different services such as image editing, upscaling, or embedding. It's recommended to consult the Stability AI API Documentation for comprehensive details on all available endpoints, parameters, and usage guidelines.
curl, Postman, or integrate the API into your applications using programming languages of your choice.If you encounter any issues or have questions about the API, refer to the Stability AI Support or reach out through their official channels.
Note: Always ensure that you handle your API keys securely and adhere to the usage policies set forth by Stability AI to avoid unauthorized access or potential service disruptions.
Not yet included in a published release.