BEEOS CLOUD / DEVELOPER REFERENCE
Responses
Run a task on a configured harness and read, stream, cancel, or delete it (UHP).
Overview
The responses domain runs a task on a configured harness and reads it back (UHP). With stream: false the server returns one Response object when the task reaches a terminal state; with stream: true it returns a text/event-stream of events.
6 operations · SDK resource: TypeScript cloud.responses · Python cloud.responses · Go cloud.Responses · API overview
Operations whose path starts with /uhp/v1 are served from https://api.cloud.beeos.ai/uhp/v1 instead of https://api.cloud.beeos.ai/v1; the SDKs switch automatically.
Main objects
UHPCreateResponseRequest: the task to run (input, model, metadata, and options).UHPResponse: the task with its output items and usage; its state isUHPResponseStatus.UHPEvent: one event of a streamed response.
UHPCreateResponseRequest
| Field | Type | Required | Description |
|---|---|---|---|
input | string | array<map<string, JSONValue>> | yes | A bare string is shorthand for one user message. |
model | string | no | Model id for this turn. Omitted means the harness default. Any requested id is dispatched as given. |
metadata | object | no | Client metadata, the extension point of the Responses surface. harness_id selects the configured harness; environment names the environment this task reads, overriding the harness's (capability environments), refused with environment_not_found or environment_not_ready before the task starts. |
metadata.harness_id | string | no | ID of the harness that runs the task. Optional when exactly one harness is in scope; required when there are several. |
metadata.environment | string | no | Name of an environment for the task to read. This server does not serve environments: a non-empty value is rejected with 404 environment_not_found. |
stream | boolean | no | When true the response is streamed as server-sent events; see UHPEvent. Otherwise the call returns the finished response. Defaults to false. Default: false. |
previous_response_id | string | no | ID of an earlier response to continue. The new response runs in the same session. The earlier response must exist and belong to the same harness. Nullable. |
instructions | string | no | Instructions placed before the input text and separated from it by a line containing ---. |
store | boolean | no | Whether to keep the response so it can be fetched later. Defaults to true. Default: true. |
max_output_tokens | integer | no | Reserved and ignored. It is reported in metadata.ignored_fields of the response. Nullable. |
max_step | integer | no | Agent step (tool-call round) budget. Nullable. |
timeout_seconds | integer | no | Wall-clock budget. Nullable. |
tools | array<map<string, JSONValue>> | no | Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in metadata.ignored_fields on the response. A UHP harness invokes and executes tools itself and reports them in output; there is no input path for a tool result, so the client-executed tool loop this field implies cannot be completed by a conformant server. Configure tools on the harness instead — see Harnesses §4.1. Tasks §1.4. |
include | array<string> | no | Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in metadata.ignored_fields on the response. No values are enumerated, so any string a server recognised would be one it named itself. Tasks §1.4. |
background | boolean | no | When true on a request that is not streamed, the call returns at once with the response still in_progress; fetch the result later. Ignored when stream is true. Default: false. |
Every field, and the methods that use this object: appendix.
UHPResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the response. It starts with resp_. Constraints: pattern=^resp_. |
object | string | yes | Object type. Allowed values: "response" — A response object. |
created_at | integer | yes | Unix seconds |
status | UHPResponseStatus | yes | Status of the response. See UHPResponseStatus for the values. Allowed values: see the table below, UHPResponseStatus values. |
error | UHPError | no | Non-null only when status is failed. Nullable. |
incomplete_details | map<string, JSONValue> | no | Why the response is incomplete. When status is incomplete it holds reason, which is timeout when the time limit was reached. The protocol also defines max_tokens for the output limit, but this service does not currently produce it. Otherwise null. Nullable. |
previous_response_id | string | no | ID of the response this one continues, when the request set previous_response_id. Nullable. |
model | string | yes | The model that actually ran. |
output | array<UHPOutputItem> | yes | Output items produced so far, in order. |
store | boolean | no | Whether the response is kept so it can be fetched later. |
usage | UHPUsage | no | null when the server cannot account for usage. A fabricated zero would be worse than an honest absence, because a client cannot tell it from a free task. Nullable. |
metadata | object | no | Extra information about the run. |
metadata.session_id | string | no | ID of the session the response ran in. Responses chained with previous_response_id share it. |
metadata.environment | string | no | The environment the task read, when it read one (capability environments). |
metadata.requested_model | string | no | The id the client sent, when the client sent one. |
metadata.model_fallback | boolean | no | True only when the harness reported it could not switch to the requested model. |
metadata.model_fallback_reason | string | no | Why the harness ran its default model instead of the requested one. When the harness gives no reason, it is The harness ran its default model. |
metadata.ignored_fields | array<string> | no | Request fields the server did not act on, by name, in any order. Required when the request carried tools or include, which are reserved and ignored. A silently ignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4. |
UHPResponseStatus values
| Value | Meaning |
|---|---|
"in_progress" | The response is still running. |
"completed" | The response finished successfully. |
"failed" | The work could not be done. |
"incomplete" | A limit, such as the output limit or the time limit, stopped the work. It is usually worth continuing. |
"cancelled" | The client asked to stop. A cancelled response is never reported as failed. |
Every field, and the methods that use this object: appendix.
UHPEvent
One streamed event. sequence_number starts at 0 and increases by exactly 1 per event, so a client can detect a dropped event rather than silently rendering a gap.
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Kind of the event. Clients should ignore event types they do not know. Exactly one of response.completed, response.incomplete and response.failed ends a stream. Allowed values: see the table below, UHPEvent.type values. Structure by type: see the variant table. |
sequence_number | integer | yes | Position of the event in the stream, starting at 0 and increasing by 1 per event. A gap means an event was lost. Constraints: minimum=0. |
response | UHPResponse | no | Snapshot of the response. Present on lifecycle events. |
item | UHPOutputItem | no | The output item. Present on response.output_item.added and response.output_item.done. |
part | UHPContentPart | no | The content or summary part. Present on content part and reasoning summary part events. |
annotation | UHPAnnotation | no | The annotation. Present on response.output_text.annotation.added. |
delta | string | no | New text, or new function arguments, since the previous delta. |
text | string | no | The complete text. Present on response.output_text.done. |
arguments | string | no | The complete function arguments as a JSON string. Present on response.function_call_arguments.done. |
item_id | string | no | ID of the output item the event belongs to. |
output_index | integer | no | Position of the item in the output of the response. Constraints: minimum=0. |
content_index | integer | no | Index of the content part within the item. Constraints: minimum=0. |
summary_index | integer | no | Index of the summary part within the item. Constraints: minimum=0. |
annotation_index | integer | no | Index of the annotation within the content part. Constraints: minimum=0. |
code | string | no | Machine-readable error code. Present on error events. |
message | string | no | Readable error message. Present on error events. |
param | string | no | Dotted path of the field the error is about, or null. Present on error events. Nullable. |
UHPEvent.type values
| Value | Meaning |
|---|---|
"response.created" | The response was created. response is the initial snapshot with status in_progress. |
"response.in_progress" | The response is running. response is a snapshot. |
"response.output_item.added" | A new output item started. item is its initial form and output_index its position in the output. |
"response.output_item.done" | An output item is complete. item is its final form. |
"response.content_part.added" | A content part was added to a message item. part is its initial form. |
"response.content_part.done" | A content part of a message item is complete. part is its final form. |
"response.output_text.delta" | More text was appended to the text of a message item. delta is the new text. |
"response.output_text.done" | The text of a message item is complete. text is the full text. |
"response.output_text.annotation.added" | An annotation, such as a file citation, was added to the text of a message item. |
"response.reasoning_summary_part.added" | A summary part was added to a reasoning item. |
"response.reasoning_summary_text.delta" | More text was appended to the summary of a reasoning item. delta is the new text. |
"response.reasoning_summary_part.done" | A summary part of a reasoning item is complete. part is its final form. |
"response.function_call_arguments.delta" | The arguments of a function_call item were written. delta holds the arguments text. |
"response.function_call_arguments.done" | The arguments of a function_call item are complete. arguments holds them as a JSON string. |
"response.completed" | The response finished successfully. This is a terminal event: exactly one terminal event ends the stream. |
"response.incomplete" | The response stopped because of a limit, for example the output limit or the time limit. This is a terminal event. |
"response.failed" | The response failed or was cancelled; response.status is failed or cancelled. This is a terminal event. |
"error" | An error that did not end the response. code, message and param describe it, and a terminal event still follows. |
"beeos.approval.requested" | BeeOS extension. The agent asks for approval of an action. The approval property holds the approval request document. |
"beeos.approval.resolved" | BeeOS extension. An approval request was resolved. The approval property holds the resolution document. |
"beeos.question.requested" | BeeOS extension. The agent asks the user a question. The question property holds the question request document. |
"beeos.question.resolved" | BeeOS extension. A question request was resolved. The question property holds the resolution document. |
Every field, and the methods that use this object: appendix.
UHPOutputItem
A client must tolerate item types it does not recognise. A client that renders only message items and ignores the rest is a valid client.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | ID of the output item. |
type | string | yes | Kind of the output item. Clients should ignore item types they do not know. Allowed values: "message" — A message written by the agent. Its text is in content; "reasoning" — The agent's reasoning. Its summary is in summary; "function_call" — A tool call made by the agent, with name and arguments; "function_call_output" — The result of a tool call, in output. (enum table) Structure by type: see the variant table. |
status | string | no | Progress of the item. Allowed values: "in_progress" — The item is still being produced; "completed" — The item is complete. (enum table) |
role | string | no | Who wrote a message item. Allowed values: "assistant" — The agent. |
content | array<UHPContentPart> | no | Content parts of a message item. |
summary | array<map<string, JSONValue>> | no | Summary of a reasoning item. |
call_id | string | no | ID of the function call. A function_call_output item refers to its call with the same call_id. |
name | string | no | Name of the function the agent called. |
arguments | string | no | JSON, as a string |
output | string | no | Result of the function call, as text. |
Every field, and the methods that use this object: appendix.
UHPContentPart
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Kind of the part. Allowed values: "output_text" — Text of a message item, with optional annotations; "summary_text" — Summary text of a reasoning item. (enum table) Structure by type: see the variant table. |
text | string | no | Text of the part. |
annotations | array<UHPAnnotation> | no | Annotations that refer to ranges of text. |
Every field, and the methods that use this object: appendix.
UHPAnnotation
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Kind of the annotation. Allowed values: "container_file_citation" — The text refers to a file produced by the agent. |
container_id | string | no | ID of the container that holds the file. BeeOS does not currently set it. |
file_id | string | no | ID of the file. BeeOS does not currently set it. |
filename | string | no | Name of the file. |
download_url | string | no | Absolute URL the file can be downloaded from. Constraints: format=uri. |
start_index | integer | no | Start of the cited range in the text, counted in characters. BeeOS sets it to 0. |
end_index | integer | no | End of the cited range in the text, counted in characters. BeeOS sets it to the length of the text. |
Every field, and the methods that use this object: appendix.
Typical flow
- Run a task with
responses.create; retries must carry the sameIdempotency-Key. - Read the task back with
responses.get, or follow or resume its events withresponses.getEvents. - Stop a running task with
responses.cancel; cancelling a task that already ended succeeds and changes nothing. - Read the original input with
responses.getInputItems. - Remove the stored response with
responses.delete; deleting does not cancel a running task.
Methods
| Method | HTTP | Summary |
|---|---|---|
| responses.create | POST /uhp/v1/responses | Run a task |
| responses.get | GET /uhp/v1/responses/{response_id} | Read a task back |
| responses.delete | DELETE /uhp/v1/responses/{response_id} | Delete a stored response |
| responses.cancel | POST /uhp/v1/responses/{response_id}/cancel | Cancel a running task |
| responses.getEvents | GET /uhp/v1/responses/{response_id}/events | Stream or resume the events of a response |
| responses.getInputItems | GET /uhp/v1/responses/{response_id}/input_items | The input the task was created with |
responses.create
POST /uhp/v1/responses · Operation ID createResponse
Run a task
The core of the protocol. With stream: false the server returns one Response object when the task reaches a terminal state. With stream: true it returns text/event-stream carrying the events defined in the Streaming chapter. Retries MUST carry Idempotency-Key: without one, a retry after a timeout runs the task a second time while the first may still be running.
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.create | create(input: Models.UHPCreateResponseJSONRequest, idempotencyKey?: string, UHPVersion?: string): Promise<Models.CreateResponseResponse> |
| TypeScript | cloud.responses.createStream | createStream(input: Models.UHPCreateResponseStreamRequest, idempotencyKey?: string): Promise<AsyncIterable<Models.UHPEvent>> |
| Python | cloud.responses.create | def create(self, input: UHPCreateResponseJSONRequest, options: CreateResponseOptions | None = None) -> UHPResponse |
| Python | cloud.responses.create_stream | def create_stream(self, input: UHPCreateResponseRequest, options: CreateResponseOptions | None = None) -> Iterator[UHPEvent] |
| Go | cloud.Responses.Create | func (r *ResponsesResource) Create(ctx context.Context, input UHPCreateResponseJSONRequest, options CreateResponseOptions) (UHPResponse, error) |
| Go | cloud.Responses.CreateStream | func (r *ResponsesResource) CreateStream(ctx context.Context, input UHPCreateResponseJSONRequest, options CreateResponseOptions) (*UHPEventStream, error) |
cloud.responses.createStream: Creates a Response with stream: true and returns the server-sent events as an async iterable. The method spreads input and forces stream: true before calling POST /responses with responseType: "sse".
cloud.responses.create_stream: Creates a Response with stream: True and yields the server-sent events as decoded JSON values. It copies input, forces stream to True, and posts to /responses; options are sent as headers unchanged.
cloud.Responses.CreateStream: Creates a Response with stream forced to true and returns an *UHPEventStream. Read events with Next() until it returns io.EOF, and call Close() when done. options are sent as headers.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | no | Repeating a key returns the first request's result and does not re-execute. Constraints: maxLength=255. |
UHP-Version | header | string | no | Protocol version to use: 2026-10-04 (the default), 2026-09-28, 2026-09-12 or 2026-08-11. The version served is echoed in the same header of the response. An unsupported version is rejected with unsupported_protocol_version. |
Request body
application/json · required · Schema: UHPCreateResponseRequest
| Field | Type | Required | Description |
|---|---|---|---|
input | string | array<map<string, JSONValue>> | yes | A bare string is shorthand for one user message. |
model | string | no | Model id for this turn. Omitted means the harness default. Any requested id is dispatched as given. |
metadata | object | no | Client metadata, the extension point of the Responses surface. harness_id selects the configured harness; environment names the environment this task reads, overriding the harness's (capability environments), refused with environment_not_found or environment_not_ready before the task starts. |
metadata.harness_id | string | no | ID of the harness that runs the task. Optional when exactly one harness is in scope; required when there are several. |
metadata.environment | string | no | Name of an environment for the task to read. This server does not serve environments: a non-empty value is rejected with 404 environment_not_found. |
stream | boolean | no | When true the response is streamed as server-sent events; see UHPEvent. Otherwise the call returns the finished response. Defaults to false. Default: false. |
previous_response_id | string | no | ID of an earlier response to continue. The new response runs in the same session. The earlier response must exist and belong to the same harness. Nullable. |
instructions | string | no | Instructions placed before the input text and separated from it by a line containing ---. |
store | boolean | no | Whether to keep the response so it can be fetched later. Defaults to true. Default: true. |
max_output_tokens | integer | no | Reserved and ignored. It is reported in metadata.ignored_fields of the response. Nullable. |
max_step | integer | no | Agent step (tool-call round) budget. Nullable. |
timeout_seconds | integer | no | Wall-clock budget. Nullable. |
tools | array<map<string, JSONValue>> | no | Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in metadata.ignored_fields on the response. A UHP harness invokes and executes tools itself and reports them in output; there is no input path for a tool result, so the client-executed tool loop this field implies cannot be completed by a conformant server. Configure tools on the harness instead — see Harnesses §4.1. Tasks §1.4. |
include | array<string> | no | Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in metadata.ignored_fields on the response. No values are enumerated, so any string a server recognised would be one it named itself. Tasks §1.4. |
background | boolean | no | When true on a request that is not streamed, the call returns at once with the response still in_progress; fetch the result later. Ignored when stream is true. Default: false. |
Response
200 The finished Response (non-streaming), or the event stream (streaming). · application/json · Schema: UHPResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the response. It starts with resp_. Constraints: pattern=^resp_. |
object | string | yes | Object type. Allowed values: "response" — A response object. |
created_at | integer | yes | Unix seconds |
status | UHPResponseStatus | yes | Status of the response. See UHPResponseStatus for the values. Allowed values: see UHPResponseStatus values. |
error | UHPError | no | Non-null only when status is failed. Nullable. |
incomplete_details | map<string, JSONValue> | no | Why the response is incomplete. When status is incomplete it holds reason, which is timeout when the time limit was reached. The protocol also defines max_tokens for the output limit, but this service does not currently produce it. Otherwise null. Nullable. |
previous_response_id | string | no | ID of the response this one continues, when the request set previous_response_id. Nullable. |
model | string | yes | The model that actually ran. |
output | array<UHPOutputItem> | yes | Output items produced so far, in order. |
store | boolean | no | Whether the response is kept so it can be fetched later. |
usage | UHPUsage | no | null when the server cannot account for usage. A fabricated zero would be worse than an honest absence, because a client cannot tell it from a free task. Nullable. |
metadata | object | no | Extra information about the run. |
metadata.session_id | string | no | ID of the session the response ran in. Responses chained with previous_response_id share it. |
metadata.environment | string | no | The environment the task read, when it read one (capability environments). |
metadata.requested_model | string | no | The id the client sent, when the client sent one. |
metadata.model_fallback | boolean | no | True only when the harness reported it could not switch to the requested model. |
metadata.model_fallback_reason | string | no | Why the harness ran its default model instead of the requested one. When the harness gives no reason, it is The harness ran its default model. |
metadata.ignored_fields | array<string> | no | Request fields the server did not act on, by name, in any order. Required when the request carried tools or include, which are reserved and ignored. A silently ignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4. |
stream=true returns text/event-stream; stream=false returns UHPResponse
Errors
| Status | Schema | Description |
|---|---|---|
| 400 | UHPErrorEnvelope | UHP protocol error envelope |
| 401 | UHPErrorEnvelope | Missing, malformed or unknown credential |
| 404 | UHPErrorEnvelope | No such object in the caller's scope. Servers return 404 rather than 403 for objects outside the caller's scope, so that an id's existence is not disclosed. |
| 409 | UHPErrorEnvelope | session_busy or harness_mismatch |
| 422 | UHPErrorEnvelope | model_unavailable or unsupported_base |
| 429 | UHPErrorEnvelope | rate_limited or quota_exhausted |
| 503 | UHPErrorEnvelope | UHP protocol error envelope |
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.responses.create({ input: "example_input" });
console.log(result);responses.get
GET /uhp/v1/responses/{response_id} · Operation ID getResponse
Read a task back
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.get | get(response_id: string): Promise<Models.GetResponseResponse> |
| Python | cloud.responses.get | def get(self, response_id: str) -> UHPResponse |
| Go | cloud.Responses.Get | func (r *ResponsesResource) Get(ctx context.Context, responseid string) (UHPResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_id | path | string | yes | ID of the response. It starts with resp_. |
Response
200 The Response · application/json · Schema: UHPResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the response. It starts with resp_. Constraints: pattern=^resp_. |
object | string | yes | Object type. Allowed values: "response" — A response object. |
created_at | integer | yes | Unix seconds |
status | UHPResponseStatus | yes | Status of the response. See UHPResponseStatus for the values. Allowed values: see UHPResponseStatus values. |
error | UHPError | no | Non-null only when status is failed. Nullable. |
incomplete_details | map<string, JSONValue> | no | Why the response is incomplete. When status is incomplete it holds reason, which is timeout when the time limit was reached. The protocol also defines max_tokens for the output limit, but this service does not currently produce it. Otherwise null. Nullable. |
previous_response_id | string | no | ID of the response this one continues, when the request set previous_response_id. Nullable. |
model | string | yes | The model that actually ran. |
output | array<UHPOutputItem> | yes | Output items produced so far, in order. |
store | boolean | no | Whether the response is kept so it can be fetched later. |
usage | UHPUsage | no | null when the server cannot account for usage. A fabricated zero would be worse than an honest absence, because a client cannot tell it from a free task. Nullable. |
metadata | object | no | Extra information about the run. |
metadata.session_id | string | no | ID of the session the response ran in. Responses chained with previous_response_id share it. |
metadata.environment | string | no | The environment the task read, when it read one (capability environments). |
metadata.requested_model | string | no | The id the client sent, when the client sent one. |
metadata.model_fallback | boolean | no | True only when the harness reported it could not switch to the requested model. |
metadata.model_fallback_reason | string | no | Why the harness ran its default model instead of the requested one. When the harness gives no reason, it is The harness ran its default model. |
metadata.ignored_fields | array<string> | no | Request fields the server did not act on, by name, in any order. Required when the request carried tools or include, which are reserved and ignored. A silently ignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4. |
Errors
| Status | Schema | Description |
|---|---|---|
| 404 | UHPErrorEnvelope | No such object in the caller's scope. Servers return 404 rather than 403 for objects outside the caller's scope, so that an id's existence is not disclosed. |
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.responses.get("response_123");
console.log(result);responses.delete
DELETE /uhp/v1/responses/{response_id} · Operation ID deleteResponse
Delete a stored response
Must not cancel a running task — deletion and cancellation are different intentions.
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.delete | delete(response_id: string): Promise<Models.DeleteResponseResponse> |
| Python | cloud.responses.delete | def delete(self, response_id: str) -> DeleteResponseResponse |
| Go | cloud.Responses.Delete | func (r *ResponsesResource) Delete(ctx context.Context, responseid string) (DeleteResponseResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_id | path | string | yes | ID of the response. It starts with resp_. |
Response
200 Deleted · application/json
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | ID of the deleted response. |
deleted | boolean | no | Always true. A response that cannot be deleted returns an error instead. |
Errors
| Status | Schema | Description |
|---|---|---|
| 404 | UHPErrorEnvelope | No such object in the caller's scope. Servers return 404 rather than 403 for objects outside the caller's scope, so that an id's existence is not disclosed. |
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.responses.delete("response_123");
console.log(result);responses.cancel
POST /uhp/v1/responses/{response_id}/cancel · Operation ID cancelResponse
Cancel a running task
Idempotent. Cancelling an already-terminal task succeeds and changes nothing — a client retrying a cancel after a dropped connection must not be punished for having succeeded.
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.cancel | cancel(response_id: string): Promise<Models.CancelResponseResponse> |
| Python | cloud.responses.cancel | def cancel(self, response_id: str) -> UHPResponse |
| Go | cloud.Responses.Cancel | func (r *ResponsesResource) Cancel(ctx context.Context, responseid string) (UHPResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_id | path | string | yes | ID of the response. It starts with resp_. |
Response
200 The Response, now cancelling or terminal · application/json · Schema: UHPResponse
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the response. It starts with resp_. Constraints: pattern=^resp_. |
object | string | yes | Object type. Allowed values: "response" — A response object. |
created_at | integer | yes | Unix seconds |
status | UHPResponseStatus | yes | Status of the response. See UHPResponseStatus for the values. Allowed values: see UHPResponseStatus values. |
error | UHPError | no | Non-null only when status is failed. Nullable. |
incomplete_details | map<string, JSONValue> | no | Why the response is incomplete. When status is incomplete it holds reason, which is timeout when the time limit was reached. The protocol also defines max_tokens for the output limit, but this service does not currently produce it. Otherwise null. Nullable. |
previous_response_id | string | no | ID of the response this one continues, when the request set previous_response_id. Nullable. |
model | string | yes | The model that actually ran. |
output | array<UHPOutputItem> | yes | Output items produced so far, in order. |
store | boolean | no | Whether the response is kept so it can be fetched later. |
usage | UHPUsage | no | null when the server cannot account for usage. A fabricated zero would be worse than an honest absence, because a client cannot tell it from a free task. Nullable. |
metadata | object | no | Extra information about the run. |
metadata.session_id | string | no | ID of the session the response ran in. Responses chained with previous_response_id share it. |
metadata.environment | string | no | The environment the task read, when it read one (capability environments). |
metadata.requested_model | string | no | The id the client sent, when the client sent one. |
metadata.model_fallback | boolean | no | True only when the harness reported it could not switch to the requested model. |
metadata.model_fallback_reason | string | no | Why the harness ran its default model instead of the requested one. When the harness gives no reason, it is The harness ran its default model. |
metadata.ignored_fields | array<string> | no | Request fields the server did not act on, by name, in any order. Required when the request carried tools or include, which are reserved and ignored. A silently ignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4. |
Errors
| Status | Schema | Description |
|---|---|---|
| 404 | UHPErrorEnvelope | No such object in the caller's scope. Servers return 404 rather than 403 for objects outside the caller's scope, so that an id's existence is not disclosed. |
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.responses.cancel("response_123");
console.log(result);responses.getEvents
GET /uhp/v1/responses/{response_id}/events · Operation ID getResponseEvents
Stream or resume the events of a response
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.getEvents | getEvents(response_id: string, LastEventID?: string, UHPVersion?: string): Promise<Models.GetResponseEventsResponse> |
| Python | cloud.responses.get_events | def get_events(self, response_id: str, options: GetResponseEventsOptions | None = None) -> Iterator[UHPEvent] |
| Go | cloud.Responses.GetEvents | func (r *ResponsesResource) GetEvents(ctx context.Context, responseid string, options GetResponseEventsOptions) (*EventStream[UHPEvent], error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_id | path | string | yes | ID of the response. It starts with resp_. |
Last-Event-ID | header | string | no | Sequence number of the last event the client received. The stream resumes after it. Must be a non-negative integer. |
UHP-Version | header | string | no | Protocol version to use: 2026-10-04 (the default), 2026-09-28, 2026-09-12 or 2026-08-11. The version served is echoed in the same header of the response. An unsupported version is rejected with unsupported_protocol_version. |
Response
200 Server-sent protocol events · text/event-stream · Schema: UHPEvent
Streams server-sent events.
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Kind of the event. Clients should ignore event types they do not know. Exactly one of response.completed, response.incomplete and response.failed ends a stream. Allowed values: see UHPEvent.type values. Structure by type: see the variant table. |
sequence_number | integer | yes | Position of the event in the stream, starting at 0 and increasing by 1 per event. A gap means an event was lost. Constraints: minimum=0. |
response | UHPResponse | no | Snapshot of the response. Present on lifecycle events. |
item | UHPOutputItem | no | The output item. Present on response.output_item.added and response.output_item.done. |
part | UHPContentPart | no | The content or summary part. Present on content part and reasoning summary part events. |
annotation | UHPAnnotation | no | The annotation. Present on response.output_text.annotation.added. |
delta | string | no | New text, or new function arguments, since the previous delta. |
text | string | no | The complete text. Present on response.output_text.done. |
arguments | string | no | The complete function arguments as a JSON string. Present on response.function_call_arguments.done. |
item_id | string | no | ID of the output item the event belongs to. |
output_index | integer | no | Position of the item in the output of the response. Constraints: minimum=0. |
content_index | integer | no | Index of the content part within the item. Constraints: minimum=0. |
summary_index | integer | no | Index of the summary part within the item. Constraints: minimum=0. |
annotation_index | integer | no | Index of the annotation within the content part. Constraints: minimum=0. |
code | string | no | Machine-readable error code. Present on error events. |
message | string | no | Readable error message. Present on error events. |
param | string | no | Dotted path of the field the error is about, or null. Present on error events. Nullable. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const stream = await cloud.responses.getEvents("response_123");
for await (const event of stream) {
console.log(event);
}responses.getInputItems
GET /uhp/v1/responses/{response_id}/input_items · Operation ID getResponseInputItems
The input the task was created with
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.responses.getInputItems | getInputItems(response_id: string): Promise<Models.GetResponseInputItemsResponse> |
| Python | cloud.responses.get_input_items | def get_input_items(self, response_id: str) -> GetResponseInputItemsResponse |
| Go | cloud.Responses.GetInputItems | func (r *ResponsesResource) GetInputItems(ctx context.Context, responseid string) (GetResponseInputItemsResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_id | path | string | yes | ID of the response. It starts with resp_. |
Response
200 Input items · application/json
| Field | Type | Required | Description |
|---|---|---|---|
object | string | no | Object type of the list. Allowed values: "list" — A list of items. |
data | array<map<string, JSONValue>> | no | Input items of the response, as they were sent in the request. A string input appears as one message item with role user and an input_text content part. |
Errors
| Status | Schema | Description |
|---|---|---|
| 404 | UHPErrorEnvelope | No such object in the caller's scope. Servers return 404 rather than 403 for objects outside the caller's scope, so that an id's existence is not disclosed. |
| other (default) | UHPErrorEnvelope | UHP protocol error envelope |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.responses.getInputItems("response_123");
console.log(result);Structures by discriminator
UHPContentPart by type
The structure of UHPContentPart depends on its own type value.
| Value of type | Description | Structure |
|---|---|---|
"output_text" | Text of a message item, with optional annotations. | UHPContentPartOutputText |
"summary_text" | Summary text of a reasoning item. | UHPContentPartSummaryText |
UHPEvent by type
The structure of UHPEvent depends on its own type value.
| Value of type | Description | Structure |
|---|---|---|
"response.created" | The response was created. response is the initial snapshot with status in_progress. | UHPEventResponse |
"response.in_progress" | The response is running. response is a snapshot. | UHPEventResponse |
"response.completed" | The response finished successfully. This is a terminal event: exactly one terminal event ends the stream. | UHPEventResponse |
"response.incomplete" | The response stopped because of a limit, for example the output limit or the time limit. This is a terminal event. | UHPEventResponse |
"response.failed" | The response failed or was cancelled; response.status is failed or cancelled. This is a terminal event. | UHPEventResponse |
"response.output_item.added" | A new output item started. item is its initial form and output_index its position in the output. | UHPEventOutputItem |
"response.output_item.done" | An output item is complete. item is its final form. | UHPEventOutputItem |
"response.content_part.added" | A content part was added to a message item. part is its initial form. | UHPEventContentPart |
"response.content_part.done" | A content part of a message item is complete. part is its final form. | UHPEventContentPart |
"response.reasoning_summary_part.added" | A summary part was added to a reasoning item. | UHPEventReasoningSummaryPart |
"response.reasoning_summary_part.done" | A summary part of a reasoning item is complete. part is its final form. | UHPEventReasoningSummaryPart |
"response.output_text.delta" | More text was appended to the text of a message item. delta is the new text. | UHPEventOutputTextDelta |
"response.reasoning_summary_text.delta" | More text was appended to the summary of a reasoning item. delta is the new text. | UHPEventReasoningSummaryTextDelta |
"response.output_text.done" | The text of a message item is complete. text is the full text. | UHPEventOutputTextDone |
"response.output_text.annotation.added" | An annotation, such as a file citation, was added to the text of a message item. | UHPEventAnnotationAdded |
"response.function_call_arguments.delta" | The arguments of a function_call item were written. delta holds the arguments text. | UHPEventFunctionCallArgumentsDelta |
"response.function_call_arguments.done" | The arguments of a function_call item are complete. arguments holds them as a JSON string. | UHPEventFunctionCallArgumentsDone |
"error" | An error that did not end the response. code, message and param describe it, and a terminal event still follows. | UHPEventError |
"beeos.approval.requested" | BeeOS extension. The agent asks for approval of an action. The approval property holds the approval request document. | UHPEventApproval |
"beeos.approval.resolved" | BeeOS extension. An approval request was resolved. The approval property holds the resolution document. | UHPEventApproval |
"beeos.question.requested" | BeeOS extension. The agent asks the user a question. The question property holds the question request document. | UHPEventQuestion |
"beeos.question.resolved" | BeeOS extension. A question request was resolved. The question property holds the resolution document. | UHPEventQuestion |
UHPOutputItem by type
The structure of UHPOutputItem depends on its own type value.
| Value of type | Description | Structure |
|---|---|---|
"message" | A message written by the agent. Its text is in content. | UHPOutputItemMessage |
"reasoning" | The agent's reasoning. Its summary is in summary. | UHPOutputItemReasoning |
"function_call" | A tool call made by the agent, with name and arguments. | UHPOutputItemFunctionCall |
"function_call_output" | The result of a tool call, in output. | UHPOutputItemFunctionCallOutput |