ExtraKey

Bulk AI translation of own keys

Cells = keyIds × languageIds. Cells that already have a text (`alreadyTranslated`) or whose key has no default-language text (`noSource`) are skipped; the rest are translated asynchronously by the `extra_key.ai_translate` consumer, which never overwrites a text written meanwhile. `estimatedTokens` = cells × 90 and must fit what is left of the monthly AI token budget (409 `aiTokens`, for the dry run too). `dryRun=1` only answers the numbers and writes nothing. Nothing to translate → 202 with a job that is already `done`.

POST
/api/v2/tenants/{tenantId}/extra-keys/ai-translate

Authorization

BearerAuthObject
AuthorizationBearer <token>

Machine tokens only: a personal API token or a product robot token (POST /api/v2/products/{uid}/robot-tokens). A session JWT here is 401 — the web app uses the b2t_access cookie.

In: header

Path Parameters

tenantId*string

UUID of the tenant

Formatuuid

Query Parameters

dryRun?integer

1 = report only, write nothing

Value in

  • 0
  • 1

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/extra-keys/ai-translate" \  -H "Content-Type: application/json" \  -d '{    "keyIds": [      12    ],    "languageIds": [      2    ]  }'
{  "cells": 120,  "skipped": {    "alreadyTranslated": 30,    "noSource": 2  },  "estimatedTokens": 10800,  "aiTokens": {    "limit": 500000,    "used": 1200,    "left": 498800  }}
{  "jobId": "9d222c6d-893e-4e79-8201-3c9ca16a0f39",  "cells": 120,  "skipped": {    "alreadyTranslated": 30,    "noSource": 2  },  "estimatedTokens": 10800,  "aiTokens": {    "limit": 500000,    "used": 1200,    "left": 498800  }}
Empty
{  "message": {    "error": "Your request was made with invalid credentials."  }}
{  "message": {    "error": "You are not allowed to perform this action."  }}
{  "message": {    "error": "Page not found"  }}
Empty