getLiveOpenRouterData function
Implementation
Future<String> getLiveOpenRouterData() => http
.get(Uri.parse("https://openrouter.ai/api/v1/models"))
.then(
(v) => compress(
$OpenRouterModelsListResponse.fromJson(v.body).toJson(pretty: false),
allowBZip2: false,
allowZLib: false,
),
)
.catchError((e, es) {
warn("Failed to get live OpenRouter data. Using internal fallback.");
warn("$e, $es");
return _openRouterData;
});