|
| 1 | +# hostinger_api.WordPressAIContentApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**generate_images_v1**](WordPressAIContentApi.md#generate_images_v1) | **POST** /api/hosting/v1/accounts/{username}/wordpress/{software}/content/images/generate | Generate images |
| 8 | + |
| 9 | + |
| 10 | +# **generate_images_v1** |
| 11 | +> WordPressV1ContentGeneratedImagesResource generate_images_v1(username, software, word_press_v1_content_generate_images_request) |
| 12 | +
|
| 13 | +Generate images |
| 14 | + |
| 15 | +Generate one or more images from a prompt and an image type for the specified |
| 16 | +WordPress installation. Images are returned inline as base64-encoded PNGs. They match |
| 17 | +the requested aspect ratio and are never smaller than the requested size; logos are |
| 18 | +transparent PNGs cropped to the mark. |
| 19 | + |
| 20 | +Generation is synchronous and can take up to a minute. The endpoint is limited to |
| 21 | +10 requests per minute. |
| 22 | + |
| 23 | +Provide the WordPress installation (software) identifier in the path. It can |
| 24 | +be obtained from GET /api/hosting/v1/wordpress/installations (the `id` field). |
| 25 | + |
| 26 | +### Example |
| 27 | + |
| 28 | +* Bearer Authentication (apiToken): |
| 29 | + |
| 30 | +```python |
| 31 | +import hostinger_api |
| 32 | +from hostinger_api.models.word_press_v1_content_generate_images_request import WordPressV1ContentGenerateImagesRequest |
| 33 | +from hostinger_api.models.word_press_v1_content_generated_images_resource import WordPressV1ContentGeneratedImagesResource |
| 34 | +from hostinger_api.rest import ApiException |
| 35 | +from pprint import pprint |
| 36 | + |
| 37 | + |
| 38 | +# Configure Bearer authorization: apiToken |
| 39 | +configuration = hostinger_api.Configuration( |
| 40 | + access_token = os.environ["BEARER_TOKEN"] |
| 41 | +) |
| 42 | + |
| 43 | +# Enter a context with an instance of the API client |
| 44 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 45 | + # Create an instance of the API class |
| 46 | + api_instance = hostinger_api.WordPressAIContentApi(api_client) |
| 47 | + username = 'u123456789' # str | |
| 48 | + software = '1232456789' # str | WordPress installation (software) identifier |
| 49 | + word_press_v1_content_generate_images_request = hostinger_api.WordPressV1ContentGenerateImagesRequest() # WordPressV1ContentGenerateImagesRequest | |
| 50 | + |
| 51 | + try: |
| 52 | + # Generate images |
| 53 | + api_response = api_instance.generate_images_v1(username, software, word_press_v1_content_generate_images_request) |
| 54 | + print("The response of WordPressAIContentApi->generate_images_v1:\n") |
| 55 | + pprint(api_response) |
| 56 | + except Exception as e: |
| 57 | + print("Exception when calling WordPressAIContentApi->generate_images_v1: %s\n" % e) |
| 58 | +``` |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +### Parameters |
| 63 | + |
| 64 | + |
| 65 | +Name | Type | Description | Notes |
| 66 | +------------- | ------------- | ------------- | ------------- |
| 67 | + **username** | **str**| | |
| 68 | + **software** | **str**| WordPress installation (software) identifier | |
| 69 | + **word_press_v1_content_generate_images_request** | [**WordPressV1ContentGenerateImagesRequest**](WordPressV1ContentGenerateImagesRequest.md)| | |
| 70 | + |
| 71 | +### Return type |
| 72 | + |
| 73 | +[**WordPressV1ContentGeneratedImagesResource**](WordPressV1ContentGeneratedImagesResource.md) |
| 74 | + |
| 75 | +### Authorization |
| 76 | + |
| 77 | +[apiToken](../README.md#apiToken) |
| 78 | + |
| 79 | +### HTTP request headers |
| 80 | + |
| 81 | + - **Content-Type**: application/json |
| 82 | + - **Accept**: application/json |
| 83 | + |
| 84 | +### HTTP response details |
| 85 | + |
| 86 | +| Status code | Description | Response headers | |
| 87 | +|-------------|-------------|------------------| |
| 88 | +**200** | Success response | - | |
| 89 | +**422** | Validation error response | - | |
| 90 | +**401** | Unauthenticated response | - | |
| 91 | +**500** | Error response | - | |
| 92 | + |
| 93 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 94 | + |
0 commit comments