Class OpenAiImageApi
java.lang.Object
org.springframework.ai.openai.api.OpenAiImageApi
OpenAI Image API.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to constructOpenAiImageApiinstance.static final recordstatic enumOpenAI Image API model.static final recordstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenAiImageApi(String openAiToken) Deprecated, for removal: This API element is subject to removal in a future version.OpenAiImageApi(String baseUrl, String apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.OpenAiImageApi(String baseUrl, String openAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.OpenAiImageApi(String baseUrl, String apiKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.OpenAiImageApi(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Image API with the provided base URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiImageApi.Builderbuilder()org.springframework.http.ResponseEntity<OpenAiImageApi.OpenAiImageResponse>createImage(OpenAiImageApi.OpenAiImageRequest openAiImageRequest)
-
Field Details
-
DEFAULT_IMAGE_MODEL
-
-
Constructor Details
-
OpenAiImageApi
Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.Create a new OpenAI Image api with base URL set tohttps://api.openai.com.- Parameters:
openAiToken- OpenAI apiKey.
-
OpenAiImageApi
@Deprecated(forRemoval=true, since="1.0.0-M6") public OpenAiImageApi(String baseUrl, String openAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.Create a new OpenAI Image API with the provided base URL.- Parameters:
baseUrl- the base URL for the OpenAI API.openAiToken- OpenAI apiKey.
-
OpenAiImageApi
@Deprecated(forRemoval=true, since="1.0.0-M6") public OpenAiImageApi(String baseUrl, String apiKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.Create a new OpenAI Image API with the provided base URL.- Parameters:
baseUrl- the base URL for the OpenAI API.apiKey- OpenAI apiKey.restClientBuilder- the rest client builder to use.
-
OpenAiImageApi
@Deprecated(forRemoval=true, since="1.0.0-M6") public OpenAiImageApi(String baseUrl, String apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Deprecated, for removal: This API element is subject to removal in a future version.useOpenAiImageApi.Builderinstead.Create a new OpenAI Image API with the provided base URL.- Parameters:
baseUrl- the base URL for the OpenAI API.apiKey- OpenAI apiKey.headers- the http headers to use.restClientBuilder- the rest client builder to use.responseErrorHandler- the response error handler to use.
-
OpenAiImageApi
public OpenAiImageApi(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Image API with the provided base URL.- Parameters:
baseUrl- the base URL for the OpenAI API.apiKey- OpenAI apiKey.headers- the http headers to use.restClientBuilder- the rest client builder to use.responseErrorHandler- the response error handler to use.
-
-
Method Details
-
createImage
public org.springframework.http.ResponseEntity<OpenAiImageApi.OpenAiImageResponse> createImage(OpenAiImageApi.OpenAiImageRequest openAiImageRequest) -
builder
-
OpenAiImageApi.Builderinstead.