curl --request GET \
--url http://127.0.0.1:8189/api/v2/jobs/{id}/events \
--header 'Authorization: Bearer <token>'import requests
url = "http://127.0.0.1:8189/api/v2/jobs/{id}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:8189/api/v2/jobs/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8189",
CURLOPT_URL => "http://127.0.0.1:8189/api/v2/jobs/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8189/api/v2/jobs/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8189/api/v2/jobs/{id}/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8189/api/v2/jobs/{id}/events")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}Live event stream (SSE)
Server-Sent Events stream of the job’s live state. On connect the
client receives the current snapshot (a status event, the latest
progress, and the most recent preview if any), then future
updates. The stream ends after the terminal status event.
Live push only — NOT a replayable log: events carry no id, there
is no Last-Event-ID resume, and frames emitted while disconnected
are gone. Each progress event is a complete snapshot, so a single
one fully re-syncs a reconnecting client; the authoritative state is
always GET /api/v2/jobs/{id}.
curl --request GET \
--url http://127.0.0.1:8189/api/v2/jobs/{id}/events \
--header 'Authorization: Bearer <token>'import requests
url = "http://127.0.0.1:8189/api/v2/jobs/{id}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:8189/api/v2/jobs/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8189",
CURLOPT_URL => "http://127.0.0.1:8189/api/v2/jobs/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8189/api/v2/jobs/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8189/api/v2/jobs/{id}/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8189/api/v2/jobs/{id}/events")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}授权
Authorization: Bearer <api-key> — account-scoped API keys on Cloud and serverless. Self-hosted accepts unauthenticated requests by default and can be configured with a static bearer token.
路径参数
响应
SSE stream; see x-sse-events for the event catalog.
Stream of event:/data: frames. Data payloads are the JSON schemas listed in x-sse-events.