FairDeck API.

Pay-per-share REST API. Auth with a Bearer token. Every endpoint returns a hold ID — operations settle on success and void on failure.

Base URL

https://api.faircompany.ai/v1/deck

Authentication

All requests use a Bearer token. Get one from fairdeck.ai/app.

Authorization: Bearer fair_live_...

Pricing

Every share costs $0.25 per share. The cost is held against your wallet at request time, settled on success, and voided on failure.

Endpoints

POST/v1/deck/decks

Create a new share.

{
  "input": "...",
  "metadata": { "ref": "your-internal-id" }
}

Returns the resource and a hold_id:

{
  "id": "share_01HX...",
  "status": "queued",
  "hold_id": "hold_01HX...",
  "estimated_cost_usd": "$0.25"
}

GET/v1/deck/decks/:id

Fetch a share by ID. Returns full state including settled cost.

GET/v1/deck/decks

List shares. Supports cursor pagination, created_after, status, and metadata filters.

DELETE/v1/deck/decks/:id

Cancel a queued share. Held funds are released. Already-settled shares cannot be cancelled.

POST/v1/deck/webhooks

Register a webhook for share.created, share.completed, share.failed events. Signed with HMAC-SHA256.

Errors

  • 402 Payment Required — wallet balance below the hold amount. Top up at fairdeck.ai/app.
  • 401 Unauthorized — missing or invalid Bearer token.
  • 422 Unprocessable — input failed validation.
  • 429 Rate Limit — exponential backoff with the Retry-After header.
  • 5xx — held funds are auto-voided after 5 minutes if no settlement arrives.

SDKs

Typed clients available for TypeScript / Python via @fair/sdk (npm) and fair-sdk (PyPI). Full OpenAPI spec at api.faircompany.ai/openapi.