MCPcopy Create free account
hub / github.com/pollinations/pollinations / fetchModelListData

Function fetchModelListData

pollinations.ai/src/hooks/useModelList.ts:189–201  ·  view source on GitHub ↗
(
    apiKey: string | null,
)

Source from the content-addressed store, hash-verified

187}
188
189async function fetchModelListData(
190 apiKey: string | null,
191): Promise<ModelListData> {
192 const [catalog, allowed] = await Promise.all([
193 fetchCatalogModels(),
194 fetchAllowedModels(apiKey),
195 ]);
196
197 return {
198 ...catalog,
199 allowed,
200 };
201}
202
203/**
204 * Custom hook to fetch and manage available models from the API

Callers 1

useModelListFunction · 0.85

Calls 2

fetchAllowedModelsFunction · 0.85
fetchCatalogModelsFunction · 0.70

Tested by

no test coverage detected