Quickstart

Make your first API call to FairStack in under 2 minutes.

Time to complete: ~2 minutes. One API key, 72 models, 5 modalities.

1. Get your API key

Create a FairStack account and generate an API key from your dashboard.

fs_live_xxxxxxxxxxxxxxxxxxxxxxxx
export FAIRSTACK_API_KEY="fs_live_YOUR_API_KEY"

2. Generate your first image

The cheapest model is Z-Image Turbo at $0.004/image. For best quality, use GPT Image 1.5 (Elo #1 globally).

curl -X POST https://api.fairstack.ai/v1/generations/image \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "z-image-turbo", "prompt": "A serene mountain lake at sunrise, photorealistic"}'

Response:

{
  "id": "gen_abc123",
  "status": "completed",
  "url": "https://media.fairstack.ai/image/.../output.png",
  "cost": { "micro": 4000, "display": "$0.004" },
  "model": "z-image-turbo",
  "modality": "image"
}

3. Generate voice

The cheapest voice model is FairStack Voice v1 at $0.001/request.

curl -X POST https://api.fairstack.ai/v1/generations/voice \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "cosyvoice2", "prompt": "Welcome to FairStack.", "voice": "alloy"}'

4. Generate video

Video generation is asynchronous. You submit a job and poll for the result.

curl -X POST https://api.fairstack.ai/v1/generations/video \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "wan-2-1-t2v", "prompt": "A cat walking on a beach"}'

Poll GET /v1/jobs/:id until status is "completed".

5. Check your balance

curl https://api.fairstack.ai/v1/credits \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY"

Next steps