cURL
curl -N https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/stream \
-H "Authorization: Bearer ndsk_live_yourkey"for await (const evt of nd.jobs.stream("job_2Ngd9KqLmRpW")) {
console.log(evt.type, evt.data);
}
with requests.get("https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/stream",
headers={"Authorization": f"Bearer {key}", "Accept":"text/event-stream"},
stream=True) as r:
for line in r.iter_lines():
if line: print(line.decode())
<?php
$res = $client->get('jobs/job_2Ngd9KqLmRpW/stream', [
'headers' => ['Authorization' => 'Bearer '.$key, 'Accept' => 'text/event-stream'],
'stream' => true,
]);
$body = $res->getBody();
while (!$body->eof()) { echo $body->read(1024); }
"event: progress\ndata: {\"progress\":12,\"message\":\"Researching topic\"}\n\nevent: step\ndata: {\"name\":\"write\",\"completed\":false,\"active\":true}\n\nevent: progress\ndata: {\"progress\":50,\"message\":\"Drafting\"}\n\nevent: progress\ndata: {\"progress\":100,\"message\":\"Done\"}\n\nevent: done\ndata: {\"result\":{\"post_id\":142,\"slug\":\"5-minute-breathwork-for-anxious-mornings\"}}\n"{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"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"
}Jobs
Stream job progress (SSE)
Returns a text/event-stream (Server-Sent Events) feed of progress
updates for the job. Closes automatically when the job reaches a
terminal state (completed, failed, or cancelled).
Event types emitted:
progress—{ progress: 0-100, message: "..." }step—{ name, completed, active }(one per pipeline step transition)done—{ result: { ... } }(final payload)error—{ code, message }(on failure)
Read-only. Does not consume credits.
GET
/
jobs
/
{id}
/
stream
cURL
curl -N https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/stream \
-H "Authorization: Bearer ndsk_live_yourkey"for await (const evt of nd.jobs.stream("job_2Ngd9KqLmRpW")) {
console.log(evt.type, evt.data);
}
with requests.get("https://api.neuraldraft.io/v1/jobs/job_2Ngd9KqLmRpW/stream",
headers={"Authorization": f"Bearer {key}", "Accept":"text/event-stream"},
stream=True) as r:
for line in r.iter_lines():
if line: print(line.decode())
<?php
$res = $client->get('jobs/job_2Ngd9KqLmRpW/stream', [
'headers' => ['Authorization' => 'Bearer '.$key, 'Accept' => 'text/event-stream'],
'stream' => true,
]);
$body = $res->getBody();
while (!$body->eof()) { echo $body->read(1024); }
"event: progress\ndata: {\"progress\":12,\"message\":\"Researching topic\"}\n\nevent: step\ndata: {\"name\":\"write\",\"completed\":false,\"active\":true}\n\nevent: progress\ndata: {\"progress\":50,\"message\":\"Drafting\"}\n\nevent: progress\ndata: {\"progress\":100,\"message\":\"Done\"}\n\nevent: done\ndata: {\"result\":{\"post_id\":142,\"slug\":\"5-minute-breathwork-for-anxious-mornings\"}}\n"{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"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:
"job_2Ngd9KqLmRpW"
Response
SSE stream.
The response is of type string.