MCPcopy Create free account
hub / github.com/TanStack/ai / configureFalClient

Function configureFalClient

packages/ai-fal/src/utils/client.ts:21–31  ·  view source on GitHub ↗
(config?: FalClientConfig)

Source from the content-addressed store, hash-verified

19}
20
21export function configureFalClient(config?: FalClientConfig): void {
22 const apiKey = config?.apiKey ?? getFalApiKeyFromEnv()
23 fal.config({
24 credentials: apiKey,
25 // Wrap the (optionally overridden) fetch to read fal's
26 // `x-fal-billable-units` header off every response so adapters can surface
27 // the billed quantity as `result.usage`. See ./billing.ts.
28 fetch: createBillingFetch(config?.fetch),
29 ...(config?.proxyUrl ? { proxyUrl: config.proxyUrl } : {}),
30 })
31}
32
33export function generateId(prefix: string): string {
34 return _generateId(prefix)

Callers 6

constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
utils.test.tsFile · 0.90

Calls 3

createBillingFetchFunction · 0.90
getFalApiKeyFromEnvFunction · 0.85
configMethod · 0.45

Tested by

no test coverage detected