@@ -599,7 +599,18 @@ public ResponseList<AiSupportedModel> listSupportedAiProviderModels(Long userId,
599599 public ResponseObject <AiTranslate > aiTranslateStrings (Long userId , AiTranslateRequest request ) {
600600 String url = getAIPath (userId , "ai/translate" );
601601 AiTranslateResponse response = this .httpClient .post (url , request , new HttpRequestConfig (), AiTranslateResponse .class );
602+ return ResponseObject .of (response .getData ());
603+ }
602604
605+ /**
606+ * @param userId user identifier
607+ * @param aiProviderId id of AiProvider
608+ * @param path downstream endpoint path (e.g. chat/completions)
609+ * @see <a href="https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.get" target="_blank"><b>API Documentation</b></a>
610+ */
611+ public ResponseObject <Map <String , Object >> aiGatewayGet (final Long userId , final Long aiProviderId , final String path ) {
612+ String url = getAIPath (userId , "ai/providers/" + aiProviderId + "/gateway/" + path );
613+ ChatCompletionResponseObject response = this .httpClient .get (url , new HttpRequestConfig (), ChatCompletionResponseObject .class );
603614 return ResponseObject .of (response .getData ());
604615 }
605616
@@ -618,6 +629,19 @@ public ResponseObject<AiFileTranslation> addAiFileTranslation(Long userId, AiFil
618629 return ResponseObject .of (response .getData ());
619630 }
620631
632+ /**
633+ * @param userId user identifier
634+ * @param aiProviderId id of AiProvider
635+ * @param path downstream endpoint path
636+ * @param request request body
637+ * @see <a href="https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.post" target="_blank"><b>API Documentation</b></a>
638+ */
639+ public ResponseObject <Map <String , Object >> aiGatewayPost (final Long userId , final Long aiProviderId , final String path , final Map <String , Object > request ) {
640+ String url = getAIPath (userId , "ai/providers/" + aiProviderId + "/gateway/" + path );
641+ ChatCompletionResponseObject response = this .httpClient .post (url , request , new HttpRequestConfig (), ChatCompletionResponseObject .class );
642+ return ResponseObject .of (response .getData ());
643+ }
644+
621645 /**
622646 * @param userId user identifier
623647 * @param jobIdentifier AI file translation job identifier
@@ -633,6 +657,19 @@ public ResponseObject<AiFileTranslation> getAiFileTranslationStatus(Long userId,
633657 return ResponseObject .of (response .getData ());
634658 }
635659
660+ /**
661+ * @param userId user identifier
662+ * @param aiProviderId id of AiProvider
663+ * @param path downstream endpoint path
664+ * @param request request body
665+ * @see <a href="https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.put" target="_blank"><b>API Documentation</b></a>
666+ */
667+ public ResponseObject <Map <String , Object >> aiGatewayPut (final Long userId , final Long aiProviderId , final String path , final Map <String , Object > request ) {
668+ String url = getAIPath (userId , "ai/providers/" + aiProviderId + "/gateway/" + path );
669+ ChatCompletionResponseObject response = this .httpClient .put (url , request , new HttpRequestConfig (), ChatCompletionResponseObject .class );
670+ return ResponseObject .of (response .getData ());
671+ }
672+
636673 /**
637674 * @param userId user identifier
638675 * @param jobIdentifier AI file translation job identifier
@@ -646,6 +683,17 @@ public void cancelAiFileTranslation(Long userId, String jobIdentifier) {
646683 this .httpClient .delete (url , new HttpRequestConfig (), Void .class );
647684 }
648685
686+ /**
687+ * @param userId user identifier
688+ * @param aiProviderId id of AiProvider
689+ * @param path downstream endpoint path
690+ * @see <a href="https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.delete" target="_blank"><b>API Documentation</b></a>
691+ */
692+ public void aiGatewayDelete (final Long userId , final Long aiProviderId , final String path ) {
693+ String url = getAIPath (userId , "ai/providers/" + aiProviderId + "/gateway/" + path );
694+ this .httpClient .delete (url , new HttpRequestConfig (), Void .class );
695+ }
696+
649697 /**
650698 * @param userId user identifier
651699 * @param jobIdentifier AI file translation job identifier
@@ -676,6 +724,19 @@ public ResponseObject<DownloadLink> downloadAiFileTranslationStrings(Long userId
676724 return ResponseObject .of (response .getData ());
677725 }
678726
727+ /**
728+ * @param userId user identifier
729+ * @param aiProviderId id of AiProvider
730+ * @param path downstream endpoint path
731+ * @param request request body
732+ * @see <a href="https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.patch" target="_blank"><b>API Documentation</b></a>
733+ */
734+ public ResponseObject <Map <String , Object >> aiGatewayPatch (final Long userId , final Long aiProviderId , final String path , final Map <String , Object > request ) {
735+ String url = getAIPath (userId , "ai/providers/" + aiProviderId + "/gateway/" + path );
736+ ChatCompletionResponseObject response = this .httpClient .patch (url , request , new HttpRequestConfig (), ChatCompletionResponseObject .class );
737+ return ResponseObject .of (response .getData ());
738+ }
739+
679740 private String getAIPath (Long userId , String path ) {
680741 return userId != null ? String .format ("%s/users/%d/%s" , this .url , userId , path ) : String .format ("%s/%s" , this .url , path );
681742 }
0 commit comments