Request Parameters
Body
The key used to store the image on Jigsawstack file. Learn more about how to handle files in Jigsawstack’s Handling Files section.
The language code of the target language to translate to. All supported language codes can be found
here.
The specified return type for the response
Response Structure
The response format depends on the return_type
parameter:
URL Response
return_type: “url” or “base64”
Indicates whether the call was successful.
Usage information for the API call.
Number of input tokens processed.
Number of output tokens generated.
Number of tokens processed during inference time.
Total number of tokens used (input + output).
The URL of the generated file (image or PDF) that can be accessed directly.
Binary Response
return_type: “binary”
The API returns the generated file (image or PDF) directly in the response body as binary data.
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"
})
{
"success": true,
"url": "https://jigsawstack-temp.b1e91a466694ad4af04df5d05ca12d93.r2.cloudflarestorage.com/temp/283702e7-50be-4ad8-b685-97b5c5ba135f.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=7b9a19349842b7b1a9e4c2e19f05b232%2F20250916%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250916T185147Z&X-Amz-Expires=604800&X-Amz-Signature=068cf856f26a53b43c6f7b4421987890e407520f8bdea18d27877cf6d47c8a13&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
"_usage": {
"input_tokens": 56,
"output_tokens": 192,
"inference_time_tokens": 24579,
"total_tokens": 24827
}
}