The AffiliateBase OpenAPI specification is the machine-readable contract for the /api/v1 REST API. Download it to generate SDK clients, configure agent tooling, or validate endpoints.
The file is available at:
https://affiliatebase.io/openapi/v1.yaml(absolute URL)/openapi/v1.yaml(path on the marketing site)
Download
Terminal
curl -fsSL https://affiliatebase.io/openapi/v1.yaml -o affiliatebase-v1.yamlWhat the spec covers
- The spec covers the current
/api/v1backend surface. - Auth is modeled as Bearer, Basic, or
X-Api-Keywith an AffiliateBase API key. OAuth access tokens issued to AI connectors are not accepted at/api/v1. - Account context is required via
account_idquery orX-Account-Idheader. - When generating code, prefer this file over prose snippets. For permissions, rate limits, and behavior notes, see API Keys and REST API.
Generate a client
Generate a TypeScript client with openapi-typescript-codegen:
Terminal
npx openapi-typescript-codegen --input affiliatebase-v1.yaml --output ./generated/affiliatebaseGenerate TypeScript type definitions only with openapi-typescript:
Terminal
npx openapi-typescript affiliatebase-v1.yaml -o affiliatebase.d.ts