sharedkeys
SharedKeySettings
Bases: _BaseSharedKeySettings
Represents the settings for a SharedKey.
v2 API Model: SharedKeyInput
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
expiry
class-attribute
instance-attribute
The number of days until this key expires. -1 means never expires.
model_config
class-attribute
instance-attribute
max_image_pixels
instance-attribute
The maximum amount of image pixels this key can generate per job. -1 means unlimited.
max_image_steps
instance-attribute
The maximum amount of image steps this key can use per job. -1 means unlimited.
max_text_tokens
instance-attribute
The maximum amount of text tokens this key can generate per job. -1 means unlimited.
get_api_model_name
abstractmethod
classmethod
Return the name of the model as seen in the published swagger doc.
If none, there is no payload, such as for a GET request.
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
validate_restriction_values
classmethod
Validate the restriction values.
Parameters:
-
v(int) –The restriction value.
Raises:
-
ValueError–If the restriction value is invalid.
Returns:
-
int(int) –The restriction value.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
SharedKeyDetailsResponse
Bases: HordeResponseBaseModel, MessageSpecifiesSharedKeyMixin, SharedKeySettings
Information about a SharedKey, including its creating user, settings and utilization.
The data returned in this response can vary depending on the user's permissions, (creator, owner, or admin).
Represents the data returned from the following endpoints and http status codes
- /v2/sharedkeys/{sharedkey_id} | SharedKeyModifyRequest [PATCH] -> 200
- /v2/sharedkeys/{sharedkey_id} | SharedKeyDetailsRequest [GET] -> 200
- /v2/sharedkeys | SharedKeyCreateRequest [PUT] -> 200
v2 API Model: SharedKeyDetails
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
username
instance-attribute
The owning user's unique Username. It is a combination of their chosen alias plus their ID.
utilized
instance-attribute
How much kudos has been utilized via this shared key until now.
model_config
class-attribute
instance-attribute
max_image_pixels
instance-attribute
The maximum amount of image pixels this key can generate per job. -1 means unlimited.
max_image_steps
instance-attribute
The maximum amount of image steps this key can use per job. -1 means unlimited.
max_text_tokens
instance-attribute
The maximum amount of text tokens this key can generate per job. -1 means unlimited.
expiry
class-attribute
instance-attribute
The number of days until this key expires. -1 means never expires.
sharedkey_id
class-attribute
instance-attribute
The shared key ID to use for this request.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
validate_restriction_values
classmethod
Validate the restriction values.
Parameters:
-
v(int) –The restriction value.
Raises:
-
ValueError–If the restriction value is invalid.
Returns:
-
int(int) –The restriction value.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.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
validate_sharedkey_id
Ensure that the shared key ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
ExpiryStrSharedKeyDetailsResponse
Bases: HordeResponseBaseModel, MessageSpecifiesSharedKeyMixin, _BaseSharedKeySettings
The shared key details for a style.
Represents the data returned from the following endpoints and http status codes
- /v2/sharedkeys/{sharedkey_id} | SharedKeyModifyRequest [PATCH] -> 200
- /v2/sharedkeys/{sharedkey_id} | SharedKeyDetailsRequest [GET] -> 200
- /v2/sharedkeys | SharedKeyCreateRequest [PUT] -> 200
v2 API Model: _OVERLOADED_MODEL
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
expiry
class-attribute
instance-attribute
The expiry date of the shared key.
username
instance-attribute
The owning user's unique Username. It is a combination of their chosen alias plus their ID.
utilized
instance-attribute
How much kudos has been utilized via this shared key until now.
model_config
class-attribute
instance-attribute
max_image_pixels
instance-attribute
The maximum amount of image pixels this key can generate per job. -1 means unlimited.
max_image_steps
instance-attribute
The maximum amount of image steps this key can use per job. -1 means unlimited.
max_text_tokens
instance-attribute
The maximum amount of text tokens this key can generate per job. -1 means unlimited.
sharedkey_id
class-attribute
instance-attribute
The shared key ID to use for this request.
time_constructed
property
The time the model was constructed (in epoch time).
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
validate_restriction_values
classmethod
Validate the restriction values.
Parameters:
-
v(int) –The restriction value.
Raises:
-
ValueError–If the restriction value is invalid.
Returns:
-
int(int) –The restriction value.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
validate_sharedkey_id
Ensure that the shared key ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
SharedKeyDetailsRequest
Bases: BaseAIHordeRequest, MessageSpecifiesSharedKeyMixin
Request the details of a SharedKey, including its creating user, settings, and utilization.
The response data can vary depending on the user's permissions, (e.g., if they are a creator, owner, or admin).
Represents a GET request to the /v2/sharedkeys/{sharedkey_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
model_config
class-attribute
instance-attribute
sharedkey_id
class-attribute
instance-attribute
The shared key ID to use for this request.
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
validate_sharedkey_id
Ensure that the shared key ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.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
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
SharedKeyDeleteResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin
Indicates that a SharedKey was successfully deleted.
Represents the data returned from the /v2/sharedkeys/{sharedkey_id} endpoint with http status code 200.
v2 API Model: SimpleResponse
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
model_config
class-attribute
instance-attribute
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
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
SharedKeyDeleteRequest
Bases: BaseAIHordeRequest, MessageSpecifiesSharedKeyMixin, APIKeyAllowedInRequestMixin
Request to delete a SharedKey.
This is a privileged operation that requires the user to be the owner, a moderator, or an admin.
Represents a DELETE request to the /v2/sharedkeys/{sharedkey_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
sharedkey_id
class-attribute
instance-attribute
The shared key ID to use for this request.
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
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
validate_sharedkey_id
Ensure that the shared key ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.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
SharedKeyModifyRequest
Bases: BaseAIHordeRequest, SharedKeySettings, MessageSpecifiesSharedKeyMixin, APIKeyAllowedInRequestMixin
Request to modify a SharedKey.
This is a privileged operation that requires the user to be the owner, a moderator, or an admin.
Represents a PATCH request to the /v2/sharedkeys/{sharedkey_id} endpoint.
v2 API Model: SharedKeyInput
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
sharedkey_id
class-attribute
instance-attribute
The shared key ID to use for this request.
max_image_pixels
instance-attribute
The maximum amount of image pixels this key can generate per job. -1 means unlimited.
max_image_steps
instance-attribute
The maximum amount of image steps this key can use per job. -1 means unlimited.
max_text_tokens
instance-attribute
The maximum amount of text tokens this key can generate per job. -1 means unlimited.
expiry
class-attribute
instance-attribute
The number of days until this key expires. -1 means never expires.
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
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
validate_sharedkey_id
Ensure that the shared key ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
validate_restriction_values
classmethod
Validate the restriction values.
Parameters:
-
v(int) –The restriction value.
Raises:
-
ValueError–If the restriction value is invalid.
Returns:
-
int(int) –The restriction value.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.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
SharedKeyCreateRequest
Bases: BaseAIHordeRequest, SharedKeySettings, APIKeyAllowedInRequestMixin
Request to create a new SharedKey.
Represents a PUT request to the /v2/sharedkeys endpoint.
v2 API Model: SharedKeyInput
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
max_image_pixels
instance-attribute
The maximum amount of image pixels this key can generate per job. -1 means unlimited.
max_image_steps
instance-attribute
The maximum amount of image steps this key can use per job. -1 means unlimited.
max_text_tokens
instance-attribute
The maximum amount of text tokens this key can generate per job. -1 means unlimited.
expiry
class-attribute
instance-attribute
The number of days until this key expires. -1 means never expires.
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
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
validate_restriction_values
classmethod
Validate the restriction values.
Parameters:
-
v(int) –The restriction value.
Raises:
-
ValueError–If the restriction value is invalid.
Returns:
-
int(int) –The restriction value.
Source code in horde_sdk/ai_horde_api/apimodels/sharedkeys.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.