File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/kotlin/com/cjcrafter/openai Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class OpenAI @JvmOverloads constructor(
6464 val json = gson.toJson(request)
6565 val body: RequestBody = json.toRequestBody(mediaType)
6666 return Request .Builder ()
67- .url(" https://api.openai.com/v1/ $endpoint " )
67+ .url(" https://api.openai.com/$endpoint " )
6868 .addHeader(" Content-Type" , " application/json" )
6969 .addHeader(" Authorization" , " Bearer $apiKey " )
7070 .apply { if (organization != null ) addHeader(" OpenAI-Organization" , organization) }
@@ -386,8 +386,11 @@ class OpenAI @JvmOverloads constructor(
386386
387387 companion object {
388388
389- const val COMPLETIONS_ENDPOINT = " completions"
390- const val CHAT_ENDPOINT = " chat/completions"
389+ const val COMPLETIONS_ENDPOINT = " v1/completions"
390+ const val CHAT_ENDPOINT = " v1/chat/completions"
391+ const val IMAGE_CREATE_ENDPOINT = " v1/images/generations"
392+ const val IMAGE_EDIT_ENDPOINT = " v1/images/edits"
393+ const val IMAGE_VARIATION_ENDPOINT = " v1/images/variations"
391394
392395 /* *
393396 * Returns a `Gson` object that can be used to read/write .json files.
You can’t perform that action at this time.
0 commit comments