Poll session status
curl --request GET \
--url https://api.kitefrost.ai/v1/sessions/{session_id}/statusimport requests
url = "https://api.kitefrost.ai/v1/sessions/{session_id}/status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kitefrost.ai/v1/sessions/{session_id}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kitefrost.ai/v1/sessions/{session_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "https://api.kitefrost.ai/v1/sessions/{session_id}/status"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kitefrost.ai/v1/sessions/{session_id}/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/sessions/{session_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"status": "<string>",
"run_id": "<string>",
"current_phase": "<string>",
"result": {},
"hitl_context": {},
"cost_summary": {
"total_cost_usd": 0,
"total_tokens": 0,
"model_breakdown": [
{}
],
"story_units_consumed": 0,
"story_units_remaining": 123
}
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}sessions
Poll session status
Poll the status of an async generation session. Possible statuses: running, awaiting_human, completed, error. When awaiting_human, the response includes hitl_context with proposals. When completed or error, the response includes the result payload.
GET
/
v1
/
sessions
/
{session_id}
/
status
Poll session status
curl --request GET \
--url https://api.kitefrost.ai/v1/sessions/{session_id}/statusimport requests
url = "https://api.kitefrost.ai/v1/sessions/{session_id}/status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.kitefrost.ai/v1/sessions/{session_id}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kitefrost.ai/v1/sessions/{session_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "https://api.kitefrost.ai/v1/sessions/{session_id}/status"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kitefrost.ai/v1/sessions/{session_id}/status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/sessions/{session_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"status": "<string>",
"run_id": "<string>",
"current_phase": "<string>",
"result": {},
"hitl_context": {},
"cost_summary": {
"total_cost_usd": 0,
"total_tokens": 0,
"model_breakdown": [
{}
],
"story_units_consumed": 0,
"story_units_remaining": 123
}
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}Path Parameters
Response
Session status
GET /v1/sessions/{session_id}/status
Inline cost summary included in generation API responses (cost-as-output).
Show child attributes
Show child attributes
⌘I