All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.m9d2.chatgpt.OpenAIClient Maven / Gradle / Ivy

package io.github.m9d2.chatgpt;

import io.github.m9d2.chatgpt.model.audio.AudioResponse;
import io.github.m9d2.chatgpt.model.billing.BillingUsage;
import io.github.m9d2.chatgpt.model.billing.Subscription;
import io.github.m9d2.chatgpt.model.chat.Completions;
import io.github.m9d2.chatgpt.model.chat.CompletionsResponse;
import io.github.m9d2.chatgpt.model.images.Images;
import io.github.m9d2.chatgpt.model.images.ImagesResponse;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

import java.time.LocalDate;

public interface OpenAIClient {

    String URL = "https://api.openai.com/v1/";

    @POST("audio/transcriptions")
    Call transcriptions(@Body RequestBody requestBody);

    @POST("audio/translations")
    Call translations(@Body RequestBody requestBody);

    @POST("chat/completions")
    Call completions(@Body Completions body);

    @POST("images/generations")
    Call generations(@Body Images body);

    @GET("dashboard/billing/subscription")
    Call subscription();

    @GET("dashboard/billing/usage")
    Call billingUsage(@Query("start_date") LocalDate starDate, @Query("end_date") LocalDate endDate);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy