diff --git a/src/app/api/providers/fal/models/route.ts b/src/app/api/providers/fal/models/route.ts index 24418a42..80bc3a68 100644 --- a/src/app/api/providers/fal/models/route.ts +++ b/src/app/api/providers/fal/models/route.ts @@ -80,13 +80,6 @@ function mapToProviderModel(model: FalModel): ProviderModel { }; } -/** - * Build category filter query string for relevant categories - */ -function buildCategoryFilter(): string { - return RELEVANT_CATEGORIES.map((cat) => `category=${encodeURIComponent(cat)}`).join("&"); -} - interface ModelsSuccessResponse { success: true; models: ProviderModel[]; @@ -126,8 +119,9 @@ export async function GET( ); try { - // Build URL with category filter and optional search - let url = `${FAL_API_BASE}/models?${buildCategoryFilter()}&status=active`; + // Build URL - fetch all active models, filter client-side + // Note: fal.ai API only accepts single category param, so we fetch all and filter + let url = `${FAL_API_BASE}/models?status=active`; if (searchQuery) { url += `&q=${encodeURIComponent(searchQuery)}`; diff --git a/src/lib/providers/fal.ts b/src/lib/providers/fal.ts index 8c4aba6a..03300276 100644 --- a/src/lib/providers/fal.ts +++ b/src/lib/providers/fal.ts @@ -137,13 +137,6 @@ function buildHeaders(apiKey: string | null): HeadersInit { return headers; } -/** - * Build category filter query string for relevant categories - */ -function buildCategoryFilter(): string { - return RELEVANT_CATEGORIES.map((cat) => `category=${encodeURIComponent(cat)}`).join("&"); -} - /** * fal.ai provider implementation */ @@ -155,8 +148,9 @@ const falProvider: ProviderInterface = { const apiKey = getApiKeyFromStorage(); try { - // Fetch models with category filter for relevant types - const url = `${FAL_API_BASE}/models?${buildCategoryFilter()}&status=active`; + // Fetch all active models, filter client-side + // Note: fal.ai API only accepts single category param, so we fetch all and filter + const url = `${FAL_API_BASE}/models?status=active`; const response = await fetch(url, { headers: buildHeaders(apiKey), }); @@ -179,8 +173,9 @@ const falProvider: ProviderInterface = { const apiKey = getApiKeyFromStorage(); try { - // Search with query and category filter - const url = `${FAL_API_BASE}/models?q=${encodeURIComponent(query)}&${buildCategoryFilter()}&status=active`; + // Search with query, filter client-side + // Note: fal.ai API only accepts single category param, so we fetch all and filter + const url = `${FAL_API_BASE}/models?q=${encodeURIComponent(query)}&status=active`; const response = await fetch(url, { headers: buildHeaders(apiKey), });