Public endpoints
Test and deploy production-ready AI models using public endpoints.
Public endpoints are currently in beta. We’re actively expanding our model selection and working to improve the user experience. Join our Discord if you’d like to provide feedback.
RunPod public endpoints provide instant access to state-of-the-art AI models through simple API calls.
Available models
Our initial launch includes optimized text-to-image generation models:
Model | Description | Endpoint URL |
---|---|---|
Flux Dev | High-quality image generation with excellent prompt adherence | https://api.runpod.ai/v2/black-forest-labs-flux-1-dev/ |
Flux Schnell | Fast image generation optimized for speed | https://api.runpod.ai/v2/black-forest-labs-flux-1-schnell/ |
Public endpoint playground
The public endpoint playground provides a streamlined way to discover and experiment with AI models.
The playground offers:
- Interactive parameter adjustment: Modify prompts, dimensions, and model settings in real-time.
- Instant preview: Generate images directly in the browser.
- Cost estimation: See estimated costs before running generation.
- API code generation: Create working code examples for your applications.
Access the playground
- Navigate to the RunPod Hub in the console.
- Find the Public endpoints section.
- Use the dropdown menu to browse available models and select one that fits your needs.
Test a model
To test a model in the playground:
- Select a model using the dropdown menu.
- Under Input, enter a prompt in the text box.
- Enter a negative prompt if needed. Negative prompts tell the model what to exclude from the output.
- Under Additional settings, you can adjust the seed, aspect ratio, number of inference steps, guidance scale, and output format.
- Click Run to start generating.
Under Result, you can use the dropdown menu to show either a preview of the output, or the raw JSON.
Create a code example
After inputting parameters using the playground, you can automatically generate an API request to use in your application.
- Select the API tab in the UI (above the Input field).
- Using the dropdown menu, select the programming language (Python, JavaScript, cURL, etc.) and POST command you want to use (
/run
or/runsync
). - Copy the code example to your clipboard.
Make API requests to public endpoints
You can make API requests to public endpoints using any HTTP client. The endpoint URL is specific to the model you want to use.
All requests require authentication using your RunPod API key, passed in the Authorization
header. You can find and create API keys in the RunPod console under Settings > API Keys.
To learn more about the difference between synchronous and asynchronous requests, see Endpoint operations.
Synchronous request example
Here’s an example of a synchronous request to Flux Dev using the /runsync
endpoint:
Asynchronous request example
Here’s an example of an asynchronous request to Flux Dev using the /run
endpoint:
You can check the status and retrieve results using the /status
endpoint, replacing {job-id}
with the job ID returned from the /run
request:
Response format
All endpoints return a consistent JSON response format:
Model-specific parameters
Each endpoint accepts a different set of parameters to control the generation process.
Flux Dev
Flux Dev is optimized for high-quality, detailed image generation. The model accepts several parameters to control the generation process:
Parameters:
prompt
(string, required): Text description of the desired image.negative_prompt
(string, optional): Elements to exclude from the image.width
(integer, default: 1024): Image width in pixels (64-2048).height
(integer, default: 1024): Image height in pixels (64-2048).num_inference_steps
(integer, default: 20): Number of denoising steps (1-50).guidance
(float, default: 7.5): How closely to follow the prompt (1.0-20.0).seed
(integer, optional): Random seed for reproducible results.image_format
(string, default: “jpeg”): Output format (“png” or “jpeg”).
Flux Schnell
Flux Schnell is optimized for speed and real-time applications:
Parameters:
prompt
(string, required): Text description of the desired image.width
(integer, default: 1024): Image width in pixels (64-2048).height
(integer, default: 1024): Image height in pixels (64-2048).num_inference_steps
(integer, default: 4): Number of denoising steps (1-8).guidance
(float, default: 1.0): Prompt adherence strength (0.5-2.0).seed
(integer, optional): Random seed for reproducible results.
Flux Schnell is optimized for speed and works best with lower step counts. Using higher values may not improve quality significantly.
Python example
Here is an example Python API request to Flux Dev using the /run
endpoint:
You can generate public endpoint API requests for Python and other programming languages using the public endpoint playground.
Pricing
Public endpoints use transparent, usage-based pricing:
Model | Price | Billing unit |
---|---|---|
Flux Dev | $0.025 | Per megapixel |
Flux Schnell | $0.003 | Per megapixel |
Pricing examples:
- 1024×1024 image (1 megapixel): $0.025 (Flux Dev) / $0.003 (Flux Schnell)
- 512×512 image (0.25 megapixels): $0.00625 (Flux Dev) / $0.00075 (Flux Schnell)
- 2048×2048 image (4 megapixels): $0.10 (Flux Dev) / $0.012 (Flux Schnell)
Pricing is calculated based on the actual output resolution. You will not be charged for failed generations.
Best practices
Prompt engineering
When working with public endpoints, following best practices will help you achieve better results and optimize performance. For prompt engineering, be specific with detailed prompts as they generally produce better results. Include style modifiers such as art styles, camera angles, or lighting conditions. For Flux Dev, use negative prompts to exclude unwanted elements from your images.
A good prompt example would be: “A professional portrait of a woman in business attire, studio lighting, high quality, detailed, corporate headshot style.”
Performance optimization
For performance optimization, choose the right model for your needs. Use Flux Schnell when you need speed, and Flux Dev when you need higher quality. Standard dimensions like 1024×1024 render fastest, so stick to these unless you need specific aspect ratios. For multiple images, use asynchronous endpoints to batch your requests. Consider caching results by storing generated images to avoid regenerating identical prompts.