cURL (AI)
curl -X POST https://api.neuraldraft.io/v1/blog-posts \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"ai":{"topic":"5-minute breathwork","word_count":1200}}'const job = await nd.blogPosts.generate({ topic: "5-minute breathwork", wordCount: 1200 });
const result = await nd.jobs.wait(job.id);
job = requests.post(
"https://api.neuraldraft.io/v1/blog-posts",
headers={"Authorization": f"Bearer {key}"},
json={"ai": {"topic": "5-minute breathwork", "word_count": 1200}},
).json()
<?php
$job = json_decode((string) $client->post('blog-posts', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['ai' => ['topic' => '5-minute breathwork', 'word_count' => 1200]],
])->getBody(), true);
{
"id": 142,
"slug": "5-minute-breathwork-for-anxious-mornings",
"status": "published",
"title": "<string>",
"featured_image": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z",
"excerpt": "<string>",
"content": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"category": {
"id": 7,
"name": "Wellness",
"slug": "wellness"
},
"tags": [
{
"id": 21,
"name": "breathwork",
"slug": "breathwork"
}
],
"translations": [
{
"lang": "en",
"title": "<string>",
"content": "<string>",
"excerpt": "<string>",
"meta_title": "<string>",
"meta_description": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"progress": 0,
"created_at": "2026-04-19T10:14:02Z"
}{
"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/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "This API key does not have the `commerce:write` scope.",
"code": "forbidden",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/conflict",
"title": "Conflict",
"status": 409,
"detail": "A resource with this slug already exists.",
"code": "conflict",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}Blog
Create a blog post
Two creation modes:
- Manual — provide
title,content(HTML),excerpt, etc. The post is saved immediately as a draft. Costs 0 credits. - AI generation — provide
ai: { topic, style?, word_count?, translate_to_all?, primary_keyword?, ... }. Returns aJobwithtype: blog_post.generate. The post appears in the database when the job completes. Costs 60 credits (blog_post— covers research, draft, and featured image; per-language translations are billed separately at 7 credits per language).
POST
/
blog-posts
cURL (AI)
curl -X POST https://api.neuraldraft.io/v1/blog-posts \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"ai":{"topic":"5-minute breathwork","word_count":1200}}'const job = await nd.blogPosts.generate({ topic: "5-minute breathwork", wordCount: 1200 });
const result = await nd.jobs.wait(job.id);
job = requests.post(
"https://api.neuraldraft.io/v1/blog-posts",
headers={"Authorization": f"Bearer {key}"},
json={"ai": {"topic": "5-minute breathwork", "word_count": 1200}},
).json()
<?php
$job = json_decode((string) $client->post('blog-posts', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['ai' => ['topic' => '5-minute breathwork', 'word_count' => 1200]],
])->getBody(), true);
{
"id": 142,
"slug": "5-minute-breathwork-for-anxious-mornings",
"status": "published",
"title": "<string>",
"featured_image": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z",
"excerpt": "<string>",
"content": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"category": {
"id": 7,
"name": "Wellness",
"slug": "wellness"
},
"tags": [
{
"id": 21,
"name": "breathwork",
"slug": "breathwork"
}
],
"translations": [
{
"lang": "en",
"title": "<string>",
"content": "<string>",
"excerpt": "<string>",
"meta_title": "<string>",
"meta_description": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"progress": 0,
"created_at": "2026-04-19T10:14:02Z"
}{
"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/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "This API key does not have the `commerce:write` scope.",
"code": "forbidden",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/conflict",
"title": "Conflict",
"status": 409,
"detail": "A resource with this slug already exists.",
"code": "conflict",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}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.
Body
application/json
- Option 1
- Option 2
HTML body.
Example:
"en"
Optional. Auto-generated if omitted.
Available options:
draft, published, scheduled Response
Manual post created (synchronous).
Example:
142
Example:
"5-minute-breathwork-for-anxious-mornings"
Available options:
draft, published, scheduled, archived Example:
"published"
HTML for the requested language. Returned by GET /blog-posts/{id_or_slug} only.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes