Quickstart
Get up and running in under 5 minutes. Create an API key, make your first request, and handle the response.
Prerequisites
You'll need a Model Store account and an API key from the dashboard. No SDK installation required—the API is pure REST.
01
Create API Key
Navigate to the Model Store dashboard and generate your first API key. Keys are scoped to workspaces and can be rotated without downtime.
bash
# Set your API key as an environment variable
export MODELSTORE_API_KEY="msk_live_xxxxxxxxxxxx"02
Make a Request
Send a POST request to the generate endpoint with your prompt. All requests are processed asynchronously.
bash
curl -X POST "https://api.model.store/v1/generate/flux-pro" \
-H "X-API-Key: $MODELSTORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene mountain landscape at golden hour",
"resolution": "1024x1024",
"webhook_url": "https://your-app.com/webhook"
}'03
Receive Response
The API returns immediately with a job ID. Your webhook receives the completed result when generation finishes.
json
// Initial Response
{
"id": "gen_a1b2c3d4e5f6",
"status": "processing",
"estimated_time": 12
}
// Webhook Payload (when complete)
{
"id": "gen_a1b2c3d4e5f6",
"status": "completed",
"outputs": [{
"url": "https://cdn.model.store/outputs/...",
"type": "image/png"
}]
}04
Handle Errors
All errors follow a consistent format. Use the error code for programmatic handling and the suggestion for user-facing messages.
json
{
"error": {
"code": "CONTENT_FILTERED",
"message": "Content blocked by safety systems",
"suggestion": "Modify your prompt to avoid harmful content"
}
}Next steps
You're ready to integrate AI models. Explore the full API reference for advanced options.