BeginnerUpdated Dec 8, 2025
REST API Basics
Direct curl requests and response handling for when you need low-level API access without SDKs.
MP
Maya Patel
API Architect
6 min read
API Base URL
All API requests are made to:
text
https://api.abstrakt.one/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Making Your First Request
Generate an image using curl:
curl -X POST "https://api.abstrakt.one/v1/models/fal-ai/flux/schnell/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A majestic lion in the savanna at golden hour",
"image_size": {"width": 1024, "height": 1024},
"num_images": 1
}
}'Response Format
Successful response:
json
{
"request_id": "abc123",
"status": "completed",
"result": {
"items": [
{
"url": "https://cdn.abstrakt.one/images/...",
"content_type": "image/png",
"width": 1024,
"height": 1024
}
]
},
"metrics": {
"inference_time": 2.34
}
}Listing Available Models
curl -X GET "https://api.abstrakt.one/v1/models" \ -H "Authorization: Bearer YOUR_API_KEY"
Checking Job Status
For async jobs, poll the status endpoint:
curl -X GET "https://api.abstrakt.one/v1/jobs/REQUEST_ID" \ -H "Authorization: Bearer YOUR_API_KEY"
Error Handling
Error responses include a code and message:
json
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds.",
"retry_after": 60
}
}Common Error Codes
| Code | Description |
|---|---|
| UNAUTHORIZED | Invalid or missing API key |
| RATE_LIMITED | Too many requests |
| INVALID_INPUT | Malformed request body |
| MODEL_NOT_FOUND | Requested model doesn't exist |
| QUOTA_EXCEEDED | Account quota reached |
Rate Limits
Default rate limits:
- Free tier: 10 requests/minute
- Pro tier: 100 requests/minute
- Business tier: 1000 requests/minute
Check headers for limit info:
text
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1699900000
Next Steps
- Set up webhooks for async callbacks
- Learn batch processing for efficiency
- Explore error handling best practices
#rest#api#curl