dub.studioDOCS
Developers

Regenerate the SDK

Keep generated client code synchronized with the OpenAPI contract.

The SDK is generated from the API's development OpenAPI document and lives in packages/sdk/src/generated.

Regenerate after API changes

Start the API locally, then run the root generation command:

# Terminal 1
bun run --filter @ai-dubbing/api dev

# Terminal 2, from the repository root
bun generate:sdk

The generator reads:

http://localhost:3000/openapi/json

Commit the generated files with the endpoint/schema change. Consumers should never need to hand-edit files under packages/sdk/src/generated.

Update consumers

After generation, install dependencies so workspace links and lockfile metadata are current, then typecheck the consumer:

bun install
bun run --filter @ai-dubbing/client typecheck

Contract rules

  • Add endpoint response schemas before generating. The SDK can only type what appears in OpenAPI.
  • Treat exported function names as generated implementation details. The public /v1 paths currently produce names such as createDubUpload and getDub.
  • Preserve backwards compatibility for consumers, or release the SDK as a versioned package before making breaking endpoint changes.
  • Regenerate whenever a request body, response body, route path, or security requirement changes.

On this page