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

CodeDescription
UNAUTHORIZEDInvalid or missing API key
RATE_LIMITEDToo many requests
INVALID_INPUTMalformed request body
MODEL_NOT_FOUNDRequested model doesn't exist
QUOTA_EXCEEDEDAccount 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

#rest#api#curl