Overview
Make your first Segmind API request in a few minutes. Get an API key, call a model from cURL, Python, or JavaScript, and find your next steps.
This page gets you to a working API call. The request below runs a model on the AI Gateway; add your own API key to try it yourself.
Make your first request
curl -X POST "https://api.segmind.com/v1/fast-flux-schnell" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
--output output.jpg \
-d '{
"prompt": "A wallpaper of a sports car with \"Flux\" written on it, motion blur, side view",
"steps": 4,
"seed": 1184522,
"aspect_ratio": "1:1"
}'import requests
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/fast-flux-schnell"
data = {
"prompt": "A wallpaper of a sports car with 'Flux' written on it, motion blur, side view",
"steps": 4,
"seed": 1184522,
"aspect_ratio": "1:1",
}
response = requests.post(url, json=data, headers={"x-api-key": api_key})
response.raise_for_status()
with open("output.jpg", "wb") as f:
f.write(response.content)import { writeFile } from 'node:fs/promises';
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.segmind.com/v1/fast-flux-schnell';
const response = await fetch(url, {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt:
"A wallpaper of a sports car with 'Flux' written on it, motion blur, side view",
steps: 4,
seed: 1184522,
aspect_ratio: '1:1',
}),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
await writeFile('output.jpg', Buffer.from(await response.arrayBuffer()));The response body is the image, not JSON — these examples write it to
output.jpg. Run the cURL one without --output and you get a few hundred
kilobytes of JPEG in your terminal.
We highly recommend reading the Quickstart before going further.
Explore the platform
AI Gateway
Serverless models and 3rd-party models via a unified API.
Python SDK
Run any model from Python — pip install segmind, then segmind.run().
PixelFlow
Build multimodal workflows with a drag-and-drop interface.
Dedicated Endpoints
Scale from zero to peak with fast cold starts and autoscaling.
Platform
Pricing and credits, teams and spend limits, API keys, and your usage.
Start building
- Generate an image
- Generate a video
- Generate a voiceover
- Build a product-photo workflow
- Set up Dedicated Endpoints
Join our Discord community. Stay up to date, ask billing or pricing questions, and get support from fellow developers.