Module crowdin_api.api_resources.ai.resource

Classes

class AIResource (requester: APIRequester, project_id: Optional[int] = None, page_size=25)

Resource for AI.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI

Ancestors

Methods

def add_ai_custom_placeholder(self, user_id: int, body: AddAiCustomPlaceholderRequest)

Add AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use add_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.post

def add_ai_prompt(self, userId: int, request_data: AddAIPromptRequestScheme)
def add_ai_provider(self, userId: int, request_data: AddAIProviderReqeustScheme)
def add_ai_snippet(self, user_id: int, request_data: AddAiSnippetRequest)
def cancel_ai_file_translation(self, user_id: int, job_identifier: str)
def cancel_ai_prompt_completion(self, user_id: int, ai_prompt_id: int, completion_id: str)
def check_ai_report_generation_status(self, user_id: int, ai_report_id: str)
def check_ai_request_logs_export_status(self, user_id: int, export_id: str)

Check AI Request Logs Export Status

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.ai.requestLogs.exports.get

def clone_ai_prompt(self, user_id: int, ai_prompt_id: int, name: Optional[str] = None)
def create_ai_file_translation(self, user_id: int, request_data: AiFileTranslationRequest)
def create_ai_prompt_fine_tuning_job(self, user_id: int, ai_prompt_id: int, request_data: CreateAIPromptFineTuningJobRequest)
def create_ai_provider_gateway(self, user_id: int, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def create_ai_proxy_chat_completion(self, userId: int, aiProviderId: int, request_data: Union[GoogleGeminiChatProxy, OtherChatProxy])

Create AI Proxy Chat Completion

This API method serves as an intermediary, forwarding your requests directly to the selected provider. Please refer to the documentation for the specific provider you use to determine the required payload format.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.users.ai.providers.chat.completions.post

def delete_ai_custom_placeholder(self, user_id: int, ai_custom_placeholder_id: int)

Delete AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use delete_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.delete

def delete_ai_prompt(self, userId: int, aiPromptId: int)
def delete_ai_provider(self, userId: int, aiProviderId: int)
def delete_ai_provider_gateway(self, user_id: int, ai_provider_id: int, path: str)
def delete_ai_snippet(self, user_id: int, ai_snippet_id: int)
def download_ai_file_translation(self, user_id: int, job_identifier: str)
def download_ai_file_translation_strings(self, user_id: int, job_identifier: str)
def download_ai_prompt_completion(self, user_id: int, ai_prompt_id: int, completion_id: str)
def download_ai_prompt_fine_tuning_dataset(self, user_id: int, ai_prompt_id: int, job_identifier: str)
def download_ai_report(self, user_id: int, ai_report_id: str)
def download_ai_request_logs_export(self, user_id: int, export_id: str)
def edit_ai_custom_placeholder(self, user_id: int, ai_custom_placeholder_id: int, patches: Iterable[EditAiCustomPlaceholderPatch])

Edit AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use edit_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.patch

def edit_ai_prompt(self, userId: int, aiPromptId: int, request_data: Iterable[EditAIPromptScheme])
def edit_ai_provider(self, userId: int, aiProviderId: int, request_data: EditAIProviderRequestScheme)
def edit_ai_provider_gateway(self, user_id: int, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def edit_ai_settings(self, user_id: int, patches: Iterable[EditAiSettingsPatch])
def edit_ai_snippet(self, user_id: int, ai_snippet_id: int, patches: Iterable[EditAiSnippetPatch])
def export_ai_request_logs(self, user_id: int, export_format: Optional[AiRequestLogExportFormat] = None, request_id: Optional[str] = None, project_id: Optional[int] = None, request_user_id: Optional[int] = None, ai_provider_id: Optional[int] = None, model: Optional[str] = None, source_action: Optional[AiRequestLogSourceAction] = None, prompt_action: Optional[str] = None, statuses: Optional[Iterable[AiRequestLogStatus]] = None, system_credentials: Optional[bool] = None, is_auto_triggered: Optional[bool] = None, token_name: Optional[str] = None, oauth_client_id: Optional[str] = None, created_after: Optional[datetime.datetime] = None, created_before: Optional[datetime.datetime] = None)

Export AI Request Logs

Starts an asynchronous export of the AI request logs matching the filters. Poll check_ai_request_logs_export_status until the status is finished, then call download_ai_request_logs_export.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.ai.requestLogs.exports.post

def generate_ai_prompt_completion(self, user_id: int, ai_prompt_id: int, request: GenerateAiPromptCompletionRequest)
def generate_ai_prompt_fine_tuning_dataset(self, user_id: int, ai_prompt_id: int, request_data: GenerateAIPromptFineTuningDatasetRequest)
def generate_ai_report(self, user_id: int, request: GenerateAiReportRequest)
def get_ai_custom_placeholder(self, user_id: int, ai_custom_placeholder_id: int)

Get AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use get_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.get

def get_ai_custom_placeholders_path(self, user_id: int, custom_placeholder_id: Optional[int] = None)
def get_ai_file_translation_status(self, user_id: int, job_identifier: str)
def get_ai_file_translations_path(self, user_id: int, job_identifier: Optional[str] = None)
def get_ai_path(self, userId: int, aiPromptId: Optional[int] = None)
def get_ai_prompt(self, userId: int, aiPromptId: int)
def get_ai_prompt_completion_status(self, user_id: int, ai_prompt_id: int, completion_id: str)
def get_ai_prompt_completions_path(self, user_id: int, ai_prompt_id: int, completion_id: Optional[str] = None)
def get_ai_prompt_fine_tuning_dataset_generation_status(self, user_id: int, ai_prompt_id: int, job_identifier: str)

Get AI Prompt Fine-Tuning Dataset Generation Status

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.get

def get_ai_prompt_fine_tuning_datasets_path(self, user_id: int, ai_prompt_id: Optional[int] = None, job_identifier: Optional[str] = None)
def get_ai_prompt_fine_tuning_job_status(self, user_id: int, ai_prompt_id: int, job_identifier: str)
def get_ai_prompt_fine_tuning_jobs_path(self, user_id: int, ai_prompt_id: Optional[int] = None, job_identifier: Optional[str] = None)
def get_ai_provider(self, userId: int, aiProviderId: int)
def get_ai_provider_gateway(self, user_id: int, ai_provider_id: int, path: str)
def get_ai_provider_gateway_path(self, user_id: int, ai_provider_id: int, path: str) ‑> str
def get_ai_provider_path(self, userId: int, aiProviderId: Optional[int] = None)
def get_ai_reports_path(self, user_id: int, ai_report_id: Optional[str] = None)
def get_ai_request_logs_path(self, user_id: int)
def get_ai_settings(self, user_id: int)
def get_ai_settings_path(self, user_id: int)
def get_ai_snippet(self, user_id: int, ai_snippet_id: int)
def get_ai_snippets_path(self, user_id: int, ai_snippet_id: Optional[int] = None)
def get_ai_usage_member(self, user_id: int, member_id: int)

Get AI Usage Member

member_id is the identifier of the project member (or your own user id for own usage).

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.ai.usage.members.get

def get_ai_usage_members_path(self, user_id: int, member_id: Optional[int] = None)
def get_project_ai_settings(self, projectId: Optional[int] = None)
def list_ai_custom_placeholders(self, user_id: int)

List AI Custom Placeholders

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use list_ai_snippets instead.

Link to documentation: https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompt.custom.placeholders.getMany

def list_ai_prompt_fine_tuning_events(self, user_id: int, ai_prompt_id: int, job_identifier: str)
def list_ai_prompt_fine_tuning_jobs(self, user_id: int, statuses: Optional[Iterable[AiPromptFineTuningJobStatus]] = None, order_by: Optional[Sorting] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_prompts(self, userId: int, projectId: Optional[int] = None, action: Optional[AIPromptAction] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_provider_models(self, userId: int, aiProviderId: int)
def list_ai_providers(self, userId: int, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_request_logs(self, user_id: int, request_id: Optional[str] = None, project_id: Optional[int] = None, request_user_id: Optional[int] = None, ai_provider_id: Optional[int] = None, model: Optional[str] = None, source_action: Optional[AiRequestLogSourceAction] = None, prompt_action: Optional[str] = None, statuses: Optional[Iterable[AiRequestLogStatus]] = None, system_credentials: Optional[bool] = None, is_auto_triggered: Optional[bool] = None, token_name: Optional[str] = None, oauth_client_id: Optional[str] = None, created_after: Optional[datetime.datetime] = None, created_before: Optional[datetime.datetime] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_snippets(self, user_id: int, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_usage_members(self, user_id: int, user_ids: Optional[Iterable[int]] = None, order_by: Optional[Sorting] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_all_ai_provider_models(self, user_id: int)

List AI Provider Models

Lists the models of all AI providers available to the user. To list the models of a single AI provider, use list_ai_provider_models.

Link to documentation: https://support.crowdin.com/developer/api/v2/#operation/api.ai.providers.models.crowdin.getMany

def list_supported_ai_provider_models(self, user_id: int, limit: Optional[int] = None, offset: Optional[int] = None, provider_type: Optional[AIProviderType] = None, enabled: Optional[bool] = None, order_by: Optional[Sorting] = None)
def replace_ai_provider_gateway(self, user_id: int, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def translate_ai_strings(self, user_id: int, request_data: AiTranslateStringsRequest)
class EnterpriseAIResource (requester: APIRequester, project_id: Optional[int] = None, page_size=25)

Enterprise Resource for AI.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI

Ancestors

Methods

def add_ai_custom_placeholder(self, body: AddAiCustomPlaceholderRequest)

Add AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use add_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.post

def add_ai_prompt(self, request_data: AddAIPromptRequestScheme)
def add_ai_provider(self, request_data: AddAIProviderReqeustScheme)
def add_ai_snippet(self, request_data: AddAiSnippetRequest)
def cancel_ai_file_translation(self, job_identifier: str)
def cancel_ai_prompt_completion(self, ai_prompt_id: int, completion_id: str)
def check_ai_report_generation_status(self, ai_report_id: str)
def check_ai_request_logs_export_status(self, export_id: str)
def clone_ai_prompt(self, ai_prompt_id: int, name: Optional[str] = None)
def create_ai_file_translation(self, request_data: AiFileTranslationRequest)
def create_ai_prompt_fine_tuning_job(self, ai_prompt_id: int, request_data: CreateAIPromptFineTuningJobRequest)
def create_ai_provider_gateway(self, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def create_ai_proxy_chat_completion(self, aiProviderId: int, request_data: Union[GoogleGeminiChatProxy, OtherChatProxy])

Create AI Proxy Chat Completion

This API method serves as an intermediary, forwarding your requests directly to the selected provider. Please refer to the documentation for the specific provider you use to determine the required payload format.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.ai.providers.chat.completions.post

def delete_ai_custom_placeholder(self, ai_custom_placeholder_id: int)

Delete AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use delete_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.delete

def delete_ai_prompt(self, aiPromptId: int)
def delete_ai_provider(self, aiProviderId: int)
def delete_ai_provider_gateway(self, ai_provider_id: int, path: str)
def delete_ai_snippet(self, ai_snippet_id: int)
def download_ai_file_translation(self, job_identifier: str)
def download_ai_file_translation_strings(self, job_identifier: str)
def download_ai_prompt_completion(self, ai_prompt_id: int, completion_id: str)
def download_ai_prompt_fine_tuning_dataset(self, ai_prompt_id: int, job_identifier: str)
def download_ai_report(self, ai_report_id: str)
def download_ai_request_logs_export(self, export_id: str)
def edit_ai_custom_placeholder(self, ai_custom_placeholder_id: int, patches: Iterable[EditAiCustomPlaceholderPatch])

Edit AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use edit_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.patch

def edit_ai_prompt(self, aiPromptId: int, request_data: Iterable[EditAIPromptScheme])
def edit_ai_provider(self, aiProviderId: int, request_data: EditAIProviderRequestScheme)
def edit_ai_provider_gateway(self, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def edit_ai_settings(self, patches: Iterable[EditAiSettingsPatch])
def edit_ai_snippet(self, ai_snippet_id: int, patches: Iterable[EditAiSnippetPatch])
def export_ai_request_logs(self, export_format: Optional[AiRequestLogExportFormat] = None, request_id: Optional[str] = None, project_id: Optional[int] = None, request_user_id: Optional[int] = None, ai_provider_id: Optional[int] = None, model: Optional[str] = None, source_action: Optional[AiRequestLogSourceAction] = None, prompt_action: Optional[str] = None, statuses: Optional[Iterable[AiRequestLogStatus]] = None, system_credentials: Optional[bool] = None, is_auto_triggered: Optional[bool] = None, token_name: Optional[str] = None, oauth_client_id: Optional[str] = None, created_after: Optional[datetime.datetime] = None, created_before: Optional[datetime.datetime] = None)

Export AI Request Logs

Starts an asynchronous export of the AI request logs matching the filters. Poll check_ai_request_logs_export_status until the status is finished, then call download_ai_request_logs_export.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.ai.requestLogs.exports.post

def generate_ai_prompt_completion(self, ai_prompt_id: int, request: GenerateAiPromptCompletionRequest)
def generate_ai_prompt_fine_tuning_dataset(self, ai_prompt_id: int, request_data: GenerateAIPromptFineTuningDatasetRequest)
def generate_ai_report(self, request: GenerateAiReportRequest)
def get_ai_custom_placeholder(self, ai_custom_placeholder_id: int)

Get AI Custom Placeholder

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use get_ai_snippet instead.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.get

def get_ai_custom_placeholders_path(self, ai_custom_placeholder_id: Optional[int] = None)
def get_ai_file_translation_status(self, job_identifier: str)
def get_ai_file_translations_path(self, job_identifier: Optional[str] = None)
def get_ai_path(self, aiPromptId: Optional[int] = None)
def get_ai_prompt(self, aiPromptId: int)
def get_ai_prompt_completion_status(self, ai_prompt_id: int, completion_id: str)
def get_ai_prompt_completions_path(self, ai_prompt_id: int, completion_id: Optional[str] = None)
def get_ai_prompt_fine_tuning_dataset_generation_status(self, ai_prompt_id: int, job_identifier: str)
def get_ai_prompt_fine_tuning_datasets_path(self, ai_prompt_id: int, job_identifier: Optional[str] = None)
def get_ai_prompt_fine_tuning_job_status(self, ai_prompt_id: int, job_identifier: str)
def get_ai_prompt_fine_tuning_jobs_path(self, ai_prompt_id: int, job_identifier: Optional[str] = None)
def get_ai_provider(self, aiProviderId: int)
def get_ai_provider_gateway(self, ai_provider_id: int, path: str)
def get_ai_provider_gateway_path(self, ai_provider_id: int, path: str) ‑> str
def get_ai_provider_path(self, aiProviderId: Optional[int] = None)
def get_ai_reports_path(self, ai_report_id: Optional[str] = None)
def get_ai_request_logs_path(self)
def get_ai_settings(self)
def get_ai_snippet(self, ai_snippet_id: int)
def get_ai_snippets_path(self, ai_snippet_id: Optional[int] = None)
def get_ai_usage_member(self, member_id: int)

Get AI Usage Member

member_id is the identifier of the organization user.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.ai.usage.members.get

def get_ai_usage_members_path(self, member_id: Optional[int] = None)
def get_project_ai_settings(self, projectId: Optional[int] = None)
def list_ai_custom_placeholders(self)

List AI Custom Placeholders

Deprecated: AI Custom Placeholders were replaced by AI Snippets, use list_ai_snippets instead.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.custom.placeholders.getMany

def list_ai_prompt_fine_tuning_events(self, ai_prompt_id: int, job_identifier: str)
def list_ai_prompt_fine_tuning_jobs(self, statuses: Optional[Iterable[AiPromptFineTuningJobStatus]] = None, order_by: Optional[Sorting] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_prompts(self, projectId: Optional[int] = None, action: Optional[AIPromptAction] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_provider_models(self, aiProviderId: int)
def list_ai_providers(self, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_request_logs(self, request_id: Optional[str] = None, project_id: Optional[int] = None, request_user_id: Optional[int] = None, ai_provider_id: Optional[int] = None, model: Optional[str] = None, source_action: Optional[AiRequestLogSourceAction] = None, prompt_action: Optional[str] = None, statuses: Optional[Iterable[AiRequestLogStatus]] = None, system_credentials: Optional[bool] = None, is_auto_triggered: Optional[bool] = None, token_name: Optional[str] = None, oauth_client_id: Optional[str] = None, created_after: Optional[datetime.datetime] = None, created_before: Optional[datetime.datetime] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_snippets(self, limit: Optional[int] = None, offset: Optional[int] = None)
def list_ai_usage_members(self, user_ids: Optional[Iterable[int]] = None, order_by: Optional[Sorting] = None, limit: Optional[int] = None, offset: Optional[int] = None)
def list_all_ai_provider_models(self)

List AI Provider Models

Lists the models of all AI providers available in the organization. To list the models of a single AI provider, use list_ai_provider_models.

Link to documentation: https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.ai.providers.models.enterprise.getMany

def list_supported_ai_provider_models(self, limit: Optional[int] = None, offset: Optional[int] = None, provider_type: Optional[AIProviderType] = None, enabled: Optional[bool] = None, order_by: Optional[Sorting] = None)
def replace_ai_provider_gateway(self, ai_provider_id: int, path: str, request_data: Optional[Dict[~KT, ~VT]] = None)
def translate_ai_strings(self, request_data: AiTranslateStringsRequest)