cURL
curl -X POST https://api.neuraldraft.io/v1/blog-posts/142/translate \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"target_langs":["fr","de","es"]}'const job = await nd.blogPosts.translate(142, ["fr","de","es"]);
job = requests.post(
"https://api.neuraldraft.io/v1/blog-posts/142/translate",
headers={"Authorization": f"Bearer {key}"},
json={"target_langs": ["fr","de","es"]},
).json()
<?php
$job = json_decode((string) $client->post('blog-posts/142/translate', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['target_langs' => ['fr','de','es']],
])->getBody(), true);
{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Blog
Translate a blog post
Asynchronously translates the post (title, content, excerpt, meta_title,
meta_description) into one or more target languages. Returns a
Job with type: translation.batch. On completion, the
post’s translations[] array contains the new locales.
Costs 7 credits per target language (translate_language).
POST
/
blog-posts
/
{id}
/
translate
cURL
curl -X POST https://api.neuraldraft.io/v1/blog-posts/142/translate \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"target_langs":["fr","de","es"]}'const job = await nd.blogPosts.translate(142, ["fr","de","es"]);
job = requests.post(
"https://api.neuraldraft.io/v1/blog-posts/142/translate",
headers={"Authorization": f"Bearer {key}"},
json={"target_langs": ["fr","de","es"]},
).json()
<?php
$job = json_decode((string) $client->post('blog-posts/142/translate', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['target_langs' => ['fr','de','es']],
])->getBody(), true);
{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Path Parameters
Example:
142
Body
application/json
Example:
["fr", "de", "es"]
Response
Translation job queued.
Example:
"job_2Ngd9KqLmRpW"
Available options:
blog_post.generate, social_post.generate, image.generate, translation.batch, content_plan.generate, website.generate Available options:
pending, processing, completed, failed, cancelled Required range:
0 <= x <= 100Show child attributes
Show child attributes
Result payload when status is completed. Shape depends on type:
blog_post.generate→{ post_id, slug, title }social_post.generate→{ social_post_id, title, platforms }image.generate→{ url, key, width, height }translation.batch→{ keys_translated: int, locales: [string] }
Show child attributes
Show child attributes