Class OpenAiImageApi

java.lang.Object
org.springframework.ai.openai.api.OpenAiImageApi

public class OpenAiImageApi extends Object
OpenAI Image API.
See Also:
  • Field Details

    • DEFAULT_IMAGE_MODEL

      public static final String DEFAULT_IMAGE_MODEL
  • Constructor Details

    • OpenAiImageApi

      public OpenAiImageApi(String openAiToken)
      Create a new OpenAI Image api with base URL set to https://api.openai.com
      Parameters:
      openAiToken - OpenAI apiKey.
    • OpenAiImageApi

      public OpenAiImageApi(String baseUrl, String openAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder)
      Create a new OpenAI Image API with the provided base URL.
      Parameters:
      baseUrl - the base URL for the OpenAI API.
      openAiToken - OpenAI apiKey.
      restClientBuilder - the rest client builder to use.
    • OpenAiImageApi

      public OpenAiImageApi(String baseUrl, String openAiToken, 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.
      openAiToken - OpenAI apiKey.
      restClientBuilder - the rest client builder to use.
      responseErrorHandler - the response error handler to use.
  • Method Details