Skip to content

Custom AI Module

This module helps you connect AI providers not yet supported by Crowdin. Once you create this kind of app, you’ll be able to pre-translate your content with the connected AI provider and use the AI provider as an assistant in the Editor.

Access

You can grant access to this module to one of the following user categories:

For Crowdin:

  • Only me (i.e., project owner)
  • All project members
  • Selected users

For Crowdin Enterprise:

  • Only organization admins
  • All users in the organization projects
  • Selected users

Structure

manifest.json
{
"modules": {
"ai-provider": [
{
"key": "custom-ai",
"name": "Custom Open AI",
"logo": "/logo.png",
"url": "/ai-settings",
"chatCompletionsUrl": "/chat/completions",
"modelsUrl": "/models"
}
]
}
}

Properties

key

Type: string

Required: yes

Description: Module identifier within the Crowdin app.

name

Type: string

Required: yes

Description: The human-readable name of the module.

logo

Type: string

Required: yes

Description: The relative URL to the custom AI’s logo that will be displayed in the Crowdin UI.
The recommended resolution is 48x48 pixels.

url

Type: string

Required: no

Description: The relative URL to the module settings page (e.g., AI provider credentials settings, etc.).

chatCompletionsUrl

Type: string

Required: yes

Description: The relative URL used for fetching chat completions.

modelsUrl

Type: string

Required: yes

Description: The relative URL used for retrieving the list of models supported by the AI provider.

environments

Type: string

Allowed values: crowdin, crowdin-enterprise

Description: Set of environments where a module could be installed.
This parameter is needed for cross-product applications.

Communication between Custom AI App and Crowdin

Crowdin sends prompts to the app using chatCompletionsUrl, and the app then processes these prompts and responds to Crowdin with a reply.

For an improved experience when interacting with your Custom AI as an assistant in the Crowdin Editor, it is recommended to implement the stream parameter using server-sent events.

When streaming is supported, AI-generated content can be delivered progressively, providing real-time feedback to users. This improves the workflow by offering immediate suggestions or corrections without waiting for a complete response, ensuring a smooth, interactive experience for tasks like confirming terminology, checking consistency, or refining translations.

Crowdin includes the stream parameter set to true in requests to the app for chatCompletions and expects a response in the corresponding format.

When configuring a Custom AI provider in the AI > Providers page, Crowdin sends a request to the app using modelsUrl, specifically to display available models in the respective input field in the Custom AI provider settings page. You can select and save needed models, which then will be used for content pre-translation and communication with the assistant using chatCompletionsUrl.

Request to the App from Crowdin for сhatCompletions

HTTP request:

Terminal window
https://{AppBaseUrl}/chat/completions/

Request Headers

The request to chatCompletionsUrl will contain authorization headers (e.g., Authorization: Bearer <App JWT token>).

Request payload example:

{
"model": "gpt-3.5-turbo",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Prompt"
},
{
"type": "image",
"mimeType": "image/png",
"url": "https://picsum.photos/200/300"
}
]
},
{
"role": "assistant",
"content": "Reply"
},
{
"role": "user",
"content": "New prompt"
}
]
}

Expected Response from the App

Response payload example:

{
"choices": [
{
"message": {
"role": "assistant",
"content": "New reply"
}
}
]
}

Expected Response from the App (Streaming)

Response payload example:

data: {"choices":[{"delta":{"role":"assistant","content":"Your"}}]}
data: {"choices":[{"delta":{"role":"assistant","content":" rephrased"}}]}
....
data: {"choices":[{"delta":{"role":"assistant","content":" translation"}}]}
[DONE]

Response from the App to Crowdin for modelsUrl

Response payload example:

{
"data": [
{
"id": "gpt-3.5-turbo",
"supportsJsonMode": true,
"supportsFunctionCalling": true,
"supportsVision": false,
"contextWindowLimit": 16385,
"outputLimit": 4096
},
{
"id": "gpt-4-turbo",
"supportsJsonMode": true,
"supportsFunctionCalling": true,
"supportsVision": true,
"contextWindowLimit": 128000,
"outputLimit": 4096
},
{
"id": "gpt-5-power",
"supportsJsonMode": true,
"supportsFunctionCalling": true,
"supportsVision": true,
"contextWindowLimit": 1000000,
"outputLimit": 8192
},
{
"id": "gpt-6-devil",
"supportsJsonMode": true,
"supportsFunctionCalling": true,
"supportsStreaming": true,
"supportsVision": true,
"contextWindowLimit": 1000000,
"outputLimit": 8192
},
{
"id": "gpt-7-magic",
"supportsJsonMode": true,
"supportsFunctionCalling": true,
"supportsStreaming": true,
"supportsVision": true,
"contextWindowLimit": 1000000,
"outputLimit": 8192
}
]
}

Default values:

  • supportsJsonMode: false
  • supportsFunctionCalling: false
  • supportsStreaming: false
  • supportsVision: false
  • contextWindowLimit: 4096
  • outputLimit: 4096

The structure of the responses from the app should correspond to the presented examples, otherwise Crowdin will consider them invalid.

Was this page helpful?