stats
StatsModelsTimeframe
Bases: StrEnum
A timeframe for stats data.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
ImageStatsModelsResponse
Bases: HordeResponseBaseModel
Statistics for image model usage.
Represents the data returned from the /v2/stats/img/models endpoint with http status code 200.
v2 API Model: ImgModelStats
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
validate_timeframe_data
classmethod
Validate the data for a timeframe.
Parameters:
-
v(dict[str, int | None]) –The data for a timeframe.
Raises:
-
ValueError–If the data is invalid.
Returns:
-
dict[str, int]–dict[str, int]: The data for a timeframe.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
get_api_model_name
classmethod
get_timeframe
Return the data for the given timeframe.
Parameters:
-
timeframe(StatsModelsTimeframe) –The timeframe to get the data for.
Returns:
-
dict[str, int]–dict[str, int]: The data for the given timeframe.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
ImageStatsModelsRequest
Bases: BaseAIHordeRequest
Request the usage statistics for image models.
Represents a GET request to the /v2/stats/img/models endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
api_model_state
class-attribute
instance-attribute
The state of the models to get stats for. Known models are models that are known to the system.
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SinglePeriodImgStat
Bases: HordeAPIObjectBaseModel
Represents the stats for a single period of image generation.
v2 API Model: SinglePeriodImgStat
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
images
class-attribute
instance-attribute
The amount of images generated during this period.
ps
class-attribute
instance-attribute
The amount of pixelsteps generated during this period.
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
ImageStatsModelsTotalResponse
Bases: HordeResponseBaseModel
Summary statistics for all image models.
Represents the data returned from the /v2/stats/img/totals endpoint with http status code 200.
v2 API Model: StatsImgTotals
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
day
class-attribute
instance-attribute
The total stats for the past day.
hour
class-attribute
instance-attribute
The total stats for the past hour.
minute
class-attribute
instance-attribute
The total stats for the past minute.
month
class-attribute
instance-attribute
The total stats for the past month.
total
class-attribute
instance-attribute
The total stats for all time.
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
ImageStatsModelsTotalRequest
Bases: BaseAIHordeRequest
Request summary usage statistics across all image models.
Represents a GET request to the /v2/stats/img/totals endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
TextStatsModelResponse
Bases: HordeResponseBaseModel
Statistics for text model usage.
Represents the data returned from the /v2/stats/text/models endpoint with http status code 200.
v2 API Model: TxtModelStats
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
validate_timeframe_data
classmethod
Validate the data for a timeframe.
Parameters:
-
v(dict[str, int | None]) –The data for a timeframe.
Raises:
-
ValueError–If the data is invalid.
Returns:
-
dict[str, int]–dict[str, int]: The data for a timeframe.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
TextStatsModelsRequest
Bases: BaseAIHordeRequest
Request the usage statistics for text models.
Represents a GET request to the /v2/stats/text/models endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SinglePeriodTxtStat
Bases: HordeAPIObjectBaseModel
Represents the stats for a single period.
v2 API Model: SinglePeriodTxtStat
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
requests
class-attribute
instance-attribute
The number of requests made during this period.
tokens
class-attribute
instance-attribute
The number of tokens generated during this period.
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
TextStatsModelsTotalResponse
Bases: HordeResponseBaseModel
Summary statistics for all text models.
Represents the data returned from the /v2/stats/text/totals endpoint with http status code 200.
v2 API Model: StatsTxtTotals
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
TextStatsModelsTotalRequest
Bases: BaseAIHordeRequest
Summary usage statistics across all text models.
Represents a GET request to the /v2/stats/text/totals endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/stats.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.