Skip to content
Dashboard

Cancel a response

client.responses.cancel(stringid, RequestOptionsoptions?): ResponsesResponse { id, computer_id, created_at, 9 more }
POST/v1/responses/{id}/cancel

Cancel an in-progress response. Only responses with status "in_progress" can be cancelled.

ParametersExpand Collapse
id: string
ReturnsExpand Collapse
ResponsesResponse { id, computer_id, created_at, 9 more }
id?: string
computer_id?: string
created_at?: string
max_output_tokens?: number
model?: string
object?: string
output?: Array<V2GoBackendInternalServiceOutputItem { id, action, call_id, 5 more } >
id?: string
action?: V2GoBackendInternalServiceAction { button, end_x, end_y, 10 more }
button?: string
end_x?: number
end_y?: number
keys?: Array<string>
result?: string
scroll_x?: number
scroll_y?: number
status?: string
text?: string
type?: "click" | "double_click" | "triple_click" | 14 more
One of the following:
"click"
"double_click"
"triple_click"
"right_click"
"type"
"key"
"keypress"
"key_down"
"key_up"
"scroll"
"hscroll"
"navigate"
"drag"
"wait"
"terminate"
"answer"
"done"
url?: string
x?: number
y?: number
call_id?: string
content?: Array<ContentBlock { image_url, text, type } >
image_url?: string
text?: string
type?: "input_text" | "output_text" | "summary_text" | "input_image"
One of the following:
"input_text"
"output_text"
"summary_text"
"input_image"
role?: string
status?: string
summary?: Array<ContentBlock { image_url, text, type } >
image_url?: string
text?: string
type?: "input_text" | "output_text" | "summary_text" | "input_image"
One of the following:
"input_text"
"output_text"
"summary_text"
"input_image"
type?: "reasoning" | "computer_call" | "computer_call_output" | "message"
One of the following:
"reasoning"
"computer_call"
"computer_call_output"
"message"
status?: string
temperature?: number
top_p?: number
usage?: V2GoBackendInternalServiceResponsesUsage { input_tokens, output_tokens, total_tokens }
input_tokens?: number
output_tokens?: number
total_tokens?: number
viewport?: V2GoBackendInternalServiceViewport { environment, height, width }
environment?: string
height?: number
width?: number

Cancel a response

import Lightcone from '@tzafon/lightcone';

const client = new Lightcone({
  apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});

const responsesResponse = await client.responses.cancel('id');

console.log(responsesResponse.id);
{
  "id": "id",
  "computer_id": "computer_id",
  "created_at": "created_at",
  "max_output_tokens": 0,
  "model": "model",
  "object": "object",
  "output": [
    {
      "id": "id",
      "action": {
        "button": "button",
        "end_x": 0,
        "end_y": 0,
        "keys": [
          "string"
        ],
        "result": "result",
        "scroll_x": 0,
        "scroll_y": 0,
        "status": "status",
        "text": "text",
        "type": "click",
        "url": "url",
        "x": 0,
        "y": 0
      },
      "call_id": "call_id",
      "content": [
        {
          "image_url": "image_url",
          "text": "text",
          "type": "input_text"
        }
      ],
      "role": "role",
      "status": "status",
      "summary": [
        {
          "image_url": "image_url",
          "text": "text",
          "type": "input_text"
        }
      ],
      "type": "reasoning"
    }
  ],
  "status": "status",
  "temperature": 0,
  "top_p": 0,
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0
  },
  "viewport": {
    "environment": "environment",
    "height": 0,
    "width": 0
  }
}
Returns Examples
{
  "id": "id",
  "computer_id": "computer_id",
  "created_at": "created_at",
  "max_output_tokens": 0,
  "model": "model",
  "object": "object",
  "output": [
    {
      "id": "id",
      "action": {
        "button": "button",
        "end_x": 0,
        "end_y": 0,
        "keys": [
          "string"
        ],
        "result": "result",
        "scroll_x": 0,
        "scroll_y": 0,
        "status": "status",
        "text": "text",
        "type": "click",
        "url": "url",
        "x": 0,
        "y": 0
      },
      "call_id": "call_id",
      "content": [
        {
          "image_url": "image_url",
          "text": "text",
          "type": "input_text"
        }
      ],
      "role": "role",
      "status": "status",
      "summary": [
        {
          "image_url": "image_url",
          "text": "text",
          "type": "input_text"
        }
      ],
      "type": "reasoning"
    }
  ],
  "status": "status",
  "temperature": 0,
  "top_p": 0,
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0
  },
  "viewport": {
    "environment": "environment",
    "height": 0,
    "width": 0
  }
}