POST
/
v1
/
ai
/
translate
/
image
import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.translate.image({
  "url": "https://images.unsplash.com/photo-1528716321680-815a8cdb8cbe?q=80&w=1376&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
  "target_language": "hi",
  "return_type": "url"
})
{
  "url": "https://jigsawstack-temp.b1e91a466694ad4af04df5d05ca12d93.r2.cloudflarestorage.com/temp/8da8b28f-c0f6-45eb-8839-b6517b4f0592.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=7b9a19349842b7b1a9e4c2e19f05b232%2F20250623%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250623T154012Z&X-Amz-Expires=604800&X-Amz-Signature=1739b2d180f7d7001e6cc04cba6ef1ee064980b5823b91ade06f976cb2b01874&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
  "_usage": {
        "input_tokens": 83,
        "output_tokens": 186,
        "inference_time_tokens": 20075,
        "total_tokens": 20344
  }
}

Request Parameters

Body

url
string

The URL of the image containing text to translate. If provided, the image will be downloaded from this URL. Must be a valid URL. Either url or file_store_key must be provided.

file_store_key
string

The file store key of a previously uploaded image. Either url or file_store_key must be provided.

target_language
string
required

The language code of the target language to translate to. All supported language codes can be found here.

return_type
string

The specified return type for the response

  • url
  • base64
  • binary

Response Structure

success
boolean

Indicates whether the call was successful.

translated_text
string

The translated text content extracted from the image.

import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.translate.image({
  "url": "https://images.unsplash.com/photo-1528716321680-815a8cdb8cbe?q=80&w=1376&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
  "target_language": "hi",
  "return_type": "url"
})
{
  "url": "https://jigsawstack-temp.b1e91a466694ad4af04df5d05ca12d93.r2.cloudflarestorage.com/temp/8da8b28f-c0f6-45eb-8839-b6517b4f0592.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=7b9a19349842b7b1a9e4c2e19f05b232%2F20250623%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250623T154012Z&X-Amz-Expires=604800&X-Amz-Signature=1739b2d180f7d7001e6cc04cba6ef1ee064980b5823b91ade06f976cb2b01874&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
  "_usage": {
        "input_tokens": 83,
        "output_tokens": 186,
        "inference_time_tokens": 20075,
        "total_tokens": 20344
  }
}