Package net.paulem.aihorde4j.api
Interface HordeApi
public interface HordeApi
Retrofit interface for the AI Horde API v2.
-
Method Summary
Modifier and TypeMethodDescriptionretrofit2.Call<RequestStatusStable>Cancels a pending image generation request.retrofit2.Call<RequestStatusKobold>Cancels a pending text generation request.retrofit2.Call<RequestStatusCheck>Checks the status of an image generation request.retrofit2.Call<RequestStatusCheck>Checks the status of a text generation request.retrofit2.Call<UserDetails>Gets the details of the authenticated user.retrofit2.Call<RequestAsync>generateImageAsync(String apiKey, String clientAgent, GenerationInputStable request) Initiates an asynchronous image generation request.retrofit2.Call<RequestAsync>generateTextAsync(String apiKey, String clientAgent, GenerationInputKobold request) Initiates an asynchronous text generation request.retrofit2.Call<List<ActiveModel>>Gets all active models without filters.retrofit2.Call<List<ActiveModel>>getActiveModels(String type, Integer minCount) Gets the list of active models.retrofit2.Call<RequestStatusStable>Gets the full status and results of an image generation request.retrofit2.Call<RequestStatusKobold>Gets the full status and results of a text generation request.
-
Method Details
-
generateImageAsync
@POST("/v2/generate/async") retrofit2.Call<RequestAsync> generateImageAsync(@Header("apikey") String apiKey, @Header("Client-Agent") String clientAgent, @Body GenerationInputStable request) Initiates an asynchronous image generation request.- Parameters:
apiKey- The API key for authenticationclientAgent- The client agent headerrequest- The generation request parameters- Returns:
- A call that returns the async request ID
-
checkImageGeneration
@GET("/v2/generate/check/{id}") retrofit2.Call<RequestStatusCheck> checkImageGeneration(@Path("id") String id) Checks the status of an image generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the status check
-
getImageGenerationStatus
@GET("/v2/generate/status/{id}") retrofit2.Call<RequestStatusStable> getImageGenerationStatus(@Path("id") String id) Gets the full status and results of an image generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the full status with generated images
-
cancelImageGeneration
@DELETE("/v2/generate/status/{id}") retrofit2.Call<RequestStatusStable> cancelImageGeneration(@Path("id") String id) Cancels a pending image generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the status
-
generateTextAsync
@POST("/v2/generate/text/async") retrofit2.Call<RequestAsync> generateTextAsync(@Header("apikey") String apiKey, @Header("Client-Agent") String clientAgent, @Body GenerationInputKobold request) Initiates an asynchronous text generation request.- Parameters:
apiKey- The API key for authenticationclientAgent- The client agent headerrequest- The generation request parameters- Returns:
- A call that returns the async request ID
-
checkTextGeneration
@GET("/v2/generate/text/check/{id}") retrofit2.Call<RequestStatusCheck> checkTextGeneration(@Path("id") String id) Checks the status of a text generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the status check
-
getTextGenerationStatus
@GET("/v2/generate/text/status/{id}") retrofit2.Call<RequestStatusKobold> getTextGenerationStatus(@Path("id") String id) Gets the full status and results of a text generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the full status with generated text
-
cancelTextGeneration
@DELETE("/v2/generate/text/status/{id}") retrofit2.Call<RequestStatusKobold> cancelTextGeneration(@Path("id") String id) Cancels a pending text generation request.- Parameters:
id- The request UUID- Returns:
- A call that returns the status
-
findUser
@GET("/v2/find_user") retrofit2.Call<UserDetails> findUser(@Header("apikey") String apiKey, @Header("Client-Agent") String clientAgent) Gets the details of the authenticated user.- Parameters:
apiKey- The API key for authenticationclientAgent- The client agent header- Returns:
- A call that returns user details
-
getActiveModels
@GET("/v2/status/models") retrofit2.Call<List<ActiveModel>> getActiveModels(@Query("type") String type, @Query("min_count") Integer minCount) Gets the list of active models.- Parameters:
type- Filter by model type (image or text)minCount- Minimum number of workers- Returns:
- A call that returns the list of active models
-
getActiveModels
Gets all active models without filters.- Returns:
- A call that returns the list of active models
-