Agent Quickstart

Build AI agents that use FairStack for generation.

FairStack is designed for AI agents. Every API endpoint supports idempotency keys, spending caps, and cost estimation before execution.

Why agents love FairStack

  • Cost estimation -- every endpoint supports confirm: false to get a quote before generating
  • Spending caps -- set per-key budget limits so agents cannot overspend
  • Idempotency -- automatic deduplication prevents double-charges on retries
  • Simple pricing -- flat per-generation pricing, no GPU math
  • One API, all modalities -- image, video, voice, music, 3D from a single endpoint

Create a scoped API key

Create an API key with specific scopes and budget caps for your agent:

curl -X POST https://api.fairstack.ai/v1/api-keys \
  -H "Authorization: Bearer $FAIRSTACK_API_KEY" \
  -d '{"name": "my-agent", "scopes": ["generate"], "capTotalMicro": 10000000}'

This key can only generate content and has a $10 budget cap.

Estimate before generating

Use confirm: false to get a cost estimate without executing:

curl -X POST https://api.fairstack.ai/v1/generations/image \
  -H "Authorization: Bearer $AGENT_API_KEY" \
  -d '{"model": "z-image-turbo", "prompt": "test", "confirm": false}'

Next steps