ai.translate.user role, then make an API key for it; the key goes in Authorization: Api-Key.
- “Yandex” is a family, and this is the Translate API. Yandex publishes many unrelated APIs (Metrica, Search, Cloud); this plugin covers the translator, at
https://translate.api.cloud.yandex.net. The other services have their own credentials and contracts and are not part of this package. - Two credential kinds are accepted. A service-account API key is sent as
Authorization: Api-Key <key>and is long-lived, which is what a server integration wants. An IAM token is sent asBearerand expires, so the plugin passes through a key that already names its scheme — writeBearer …explicitly to use one. - A folder scopes a cloud resource. A service account’s API key or IAM token already implies its folder, so leave
folderIdout with one. A user account’s IAM token needsfolderIdon every call, even when the account reaches only one folder; the plugin sends it as thefolderIdbody field, as the API reference documents. - Every call is a POST, including the reads.
translate,detectandlanguagesall take a JSON body, which is unusual but what the gRPC-to-JSON mapping produces. - Errors are gRPC statuses, not HTTP ones. The body is
{ code, message, details }wherecodeis a gRPC status — 3 is an invalid argument, 5 not found, 7 permission denied, 8 resource exhausted, 16 unauthenticated. The HTTP status follows the gRPC code (3 answers 400, 7 answers 403, 8 answers 429, 16 answers 401), and the plugin readscodeitself, since it names the cause more precisely than the status. A bad key answers HTTP 401 with16andUnknown api key '****'. - The
requestIdis kept. It sits inside thedetailsarray, and it is what Yandex support asks for. - 10,000 characters per call, across 1,000 passages. The plugin checks the total before sending, because the API’s own refusal is a
3that does not say which limit was hit. - Omitting
sourceLanguageCodeasks for detection. Sending it empty would be an unknown language code, so the plugin leaves it out entirely when it is not set. format: HTMLpreserves markup. The default isPLAIN_TEXT, which treats tags as text to translate.- Text never reaches the event log. Only the character count and the language codes are logged, since the passage is the caller’s own content. A failed call’s
YandexAPIErrorkeeps the underlying HTTP error as itscause, which includes the request body, so do not log error causes in full if the text is sensitive.
- 3 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.More: API Key
4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List the supported languagesWhat’s next
API reference
Every
yandex.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.