Table of Contents

Class CreatorBuilder

Namespace
CivitaiSharp.Core.Request
Assembly
CivitaiSharp.Core.dll

Immutable, thread-safe request builder for creators. This endpoint uses page-based pagination instead of cursor-based; use WithPageIndex(int) to navigate between pages. Each fluent method returns a new builder instance, allowing safe reuse and caching of base configurations.

public sealed record CreatorBuilder : RequestBuilder<CreatorBuilder, Creator>, IEquatable<RequestBuilder<CreatorBuilder, Creator>>, IEquatable<CreatorBuilder>
Inheritance
CreatorBuilder
Implements
Inherited Members

Remarks

Known Issue: The /api/v1/creators endpoint has shown reliability issues including request timeouts (10+ seconds with no response) and occasional 500 Internal Server Error responses. Consider implementing extended timeout handling or retry logic when using this endpoint.

The resilience policies configured via Microsoft.Extensions.Http.Resilience will automatically handle transient failures, but persistent timeouts may still occur.

Fields

MaximumResultsPerPage

The maximum allowed value for the resultsLimit parameter in ExecuteAsync (200).

public const int MaximumResultsPerPage = 200

Field Value

int

MinimumResultsPerPage

The minimum allowed value for the resultsLimit parameter in ExecuteAsync (1).

public const int MinimumResultsPerPage = 1

Field Value

int

Properties

DefaultResultsLimit

Gets the default results limit when none is specified for this endpoint.

protected override int DefaultResultsLimit { get; }

Property Value

int

Remarks

The creators endpoint returns 20 results by default.

Endpoint

Gets the API endpoint path segment for this resource type (e.g., "models", "images").

protected override string Endpoint { get; }

Property Value

string

MaxResultsLimit

Gets the maximum allowed value for results limit for this endpoint.

protected override int MaxResultsLimit { get; }

Property Value

int

Remarks

The creators endpoint has a maximum limit of 200.

MinResultsLimit

Gets the minimum allowed value for results limit for this endpoint.

protected override int MinResultsLimit { get; }

Property Value

int

Remarks

The creators endpoint requires a minimum limit of 1. Omit the limit to return all results (up to 200 per page).

Methods

WhereName(string)

Filter creators by username (partial match via search query parameter).

public CreatorBuilder WhereName(string name)

Parameters

name string

The username to search for.

Returns

CreatorBuilder

A new builder instance with the filter applied.

Exceptions

ArgumentException

Thrown if name is null or whitespace.

With(ImmutableDictionary<string, object?>, string?, int?)

Creates a new builder instance with the specified state changes. Derived classes must implement this to return the correct derived type.

protected override CreatorBuilder With(ImmutableDictionary<string, object?> filters, string? sort, int? resultsLimit)

Parameters

filters ImmutableDictionary<string, object>

The new filters dictionary with typed values.

sort string

The new sort value.

resultsLimit int?

The new results limit.

Returns

CreatorBuilder

A new builder instance with the updated state.

WithPageIndex(int)

Set the page index for page-based pagination. The creators endpoint uses page-based pagination instead of cursor-based.

public CreatorBuilder WithPageIndex(int pageIndex)

Parameters

pageIndex int

The 1-based page index. Must be at least 1.

Returns

CreatorBuilder

A new builder instance with the page index applied.

Exceptions

ArgumentOutOfRangeException

Thrown if pageIndex is less than 1.