listModelsWithHttpInfo method

Future<Response> listModelsWithHttpInfo({
  1. String? method,
  2. String? family,
  3. String? author,
  4. String? license,
  5. int? downloadsGte,
  6. int? downloadsLte,
  7. String? createdAfter,
  8. String? createdBefore,
  9. String? delisted,
  10. String? sort,
  11. int? limit,
  12. int? offset,
  13. Future<void>? abortTrigger,
})

List models

Cost: 5-300+ credits, stepped by returned rows and multiplied by 1 + (offset/2500)². A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (delisted=live); pass delisted=dead|all to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.

Note: This method returns the HTTP Response.

Parameters:

  • String method: M-code, case-insensitive. See GET /api/v1/methods.

  • String family: Base family, for example qwen or llama.

  • String author: Publisher handle, case-insensitive.

  • String license: SPDX-ish license string as published.

  • int downloadsGte:

  • int downloadsLte:

  • String createdAfter: ISO-8601 date or timestamp, inclusive.

  • String createdBefore: ISO-8601 date or timestamp, inclusive.

  • String delisted: Tombstone filter. live (default): HF-visible models only. dead: delisted-only (same shape as this endpoint plus is_delisted=1 and last_seen_at). all: both, in one page. For a purpose-built change-stream feed, prefer GET /api/v1/models/delisted.

  • String sort: Bare key is the natural direction (downloads/likes = most first, dates = newest first). A leading - flips it. created and first_seen are aliases for the full column names.

  • int limit: Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.

  • int offset: Rows to skip. Negative and non-numeric values are treated as 0.

Implementation

Future<Response> listModelsWithHttpInfo({ String? method, String? family, String? author, String? license, int? downloadsGte, int? downloadsLte, String? createdAfter, String? createdBefore, String? delisted, String? sort, int? limit, int? offset, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/models';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (method != null) {
    queryParams.addAll(_queryParams('', 'method', method));
  }
  if (family != null) {
    queryParams.addAll(_queryParams('', 'family', family));
  }
  if (author != null) {
    queryParams.addAll(_queryParams('', 'author', author));
  }
  if (license != null) {
    queryParams.addAll(_queryParams('', 'license', license));
  }
  if (downloadsGte != null) {
    queryParams.addAll(_queryParams('', 'downloads_gte', downloadsGte));
  }
  if (downloadsLte != null) {
    queryParams.addAll(_queryParams('', 'downloads_lte', downloadsLte));
  }
  if (createdAfter != null) {
    queryParams.addAll(_queryParams('', 'created_after', createdAfter));
  }
  if (createdBefore != null) {
    queryParams.addAll(_queryParams('', 'created_before', createdBefore));
  }
  if (delisted != null) {
    queryParams.addAll(_queryParams('', 'delisted', delisted));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (offset != null) {
    queryParams.addAll(_queryParams('', 'offset', offset));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}