# Responses ## Create `responses.create(ResponseCreateParams**kwargs) -> ResponsesResponse` **post** `/v1/responses` Create a model response. Supports text conversations and computer-use (CUA) workflows. Set stream=true for server-sent events. Include tools with type "computer_use" for CUA mode, which returns structured computer_call actions. Use previous_response_id to chain multi-turn conversations. ### Parameters - `input: Optional[Iterable[Input]]` - `call_id: Optional[str]` - `content: Optional[Iterable[ContentBlockParam]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `output: Optional[ContentBlockParam]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `type: Optional[Literal["computer_call_output"]]` - `"computer_call_output"` - `instructions: Optional[str]` - `max_output_tokens: Optional[int]` - `model: Optional[str]` - `previous_response_id: Optional[str]` - `stream: Optional[bool]` - `temperature: Optional[float]` - `tools: Optional[Iterable[Tool]]` - `display_height: Optional[int]` - `display_width: Optional[int]` - `environment: Optional[str]` - `type: Optional[Literal["computer_use"]]` - `"computer_use"` - `top_p: Optional[float]` ### Returns - `class ResponsesResponse: …` - `id: Optional[str]` - `computer_id: Optional[str]` - `created_at: Optional[str]` - `max_output_tokens: Optional[int]` - `model: Optional[str]` - `object: Optional[str]` - `output: Optional[List[V2GoBackendInternalServiceOutputItem]]` - `id: Optional[str]` - `action: Optional[V2GoBackendInternalServiceAction]` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` - `call_id: Optional[str]` - `content: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `status: Optional[str]` - `summary: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]` - `"reasoning"` - `"computer_call"` - `"computer_call_output"` - `"message"` - `status: Optional[str]` - `temperature: Optional[float]` - `top_p: Optional[float]` - `usage: Optional[V2GoBackendInternalServiceResponsesUsage]` - `input_tokens: Optional[int]` - `output_tokens: Optional[int]` - `total_tokens: Optional[int]` - `viewport: Optional[V2GoBackendInternalServiceViewport]` - `environment: Optional[str]` - `height: Optional[int]` - `width: Optional[int]` ### Example ```python import os from tzafon import Lightcone client = Lightcone( api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted ) responses_response = client.responses.create() print(responses_response.id) ``` ## Retrieve `responses.retrieve(strid) -> ResponsesResponse` **get** `/v1/responses/{id}` Retrieve a previously created response by its ID, including all output items. ### Parameters - `id: str` ### Returns - `class ResponsesResponse: …` - `id: Optional[str]` - `computer_id: Optional[str]` - `created_at: Optional[str]` - `max_output_tokens: Optional[int]` - `model: Optional[str]` - `object: Optional[str]` - `output: Optional[List[V2GoBackendInternalServiceOutputItem]]` - `id: Optional[str]` - `action: Optional[V2GoBackendInternalServiceAction]` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` - `call_id: Optional[str]` - `content: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `status: Optional[str]` - `summary: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]` - `"reasoning"` - `"computer_call"` - `"computer_call_output"` - `"message"` - `status: Optional[str]` - `temperature: Optional[float]` - `top_p: Optional[float]` - `usage: Optional[V2GoBackendInternalServiceResponsesUsage]` - `input_tokens: Optional[int]` - `output_tokens: Optional[int]` - `total_tokens: Optional[int]` - `viewport: Optional[V2GoBackendInternalServiceViewport]` - `environment: Optional[str]` - `height: Optional[int]` - `width: Optional[int]` ### Example ```python import os from tzafon import Lightcone client = Lightcone( api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted ) responses_response = client.responses.retrieve( "id", ) print(responses_response.id) ``` ## Delete `responses.delete(strid) -> ResponseDeleteResponse` **delete** `/v1/responses/{id}` Permanently delete a response and all its output items. ### Parameters - `id: str` ### Returns - `class ResponseDeleteResponse: …` - `id: Optional[str]` - `deleted: Optional[bool]` - `object: Optional[str]` ### Example ```python import os from tzafon import Lightcone client = Lightcone( api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted ) response = client.responses.delete( "id", ) print(response.id) ``` ## Cancel `responses.cancel(strid) -> ResponsesResponse` **post** `/v1/responses/{id}/cancel` Cancel an in-progress response. Only responses with status "in_progress" can be cancelled. ### Parameters - `id: str` ### Returns - `class ResponsesResponse: …` - `id: Optional[str]` - `computer_id: Optional[str]` - `created_at: Optional[str]` - `max_output_tokens: Optional[int]` - `model: Optional[str]` - `object: Optional[str]` - `output: Optional[List[V2GoBackendInternalServiceOutputItem]]` - `id: Optional[str]` - `action: Optional[V2GoBackendInternalServiceAction]` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` - `call_id: Optional[str]` - `content: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `status: Optional[str]` - `summary: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]` - `"reasoning"` - `"computer_call"` - `"computer_call_output"` - `"message"` - `status: Optional[str]` - `temperature: Optional[float]` - `top_p: Optional[float]` - `usage: Optional[V2GoBackendInternalServiceResponsesUsage]` - `input_tokens: Optional[int]` - `output_tokens: Optional[int]` - `total_tokens: Optional[int]` - `viewport: Optional[V2GoBackendInternalServiceViewport]` - `environment: Optional[str]` - `height: Optional[int]` - `width: Optional[int]` ### Example ```python import os from tzafon import Lightcone client = Lightcone( api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted ) responses_response = client.responses.cancel( "id", ) print(responses_response.id) ``` ## Domain Types ### Content Block - `class ContentBlock: …` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` ### Responses Response - `class ResponsesResponse: …` - `id: Optional[str]` - `computer_id: Optional[str]` - `created_at: Optional[str]` - `max_output_tokens: Optional[int]` - `model: Optional[str]` - `object: Optional[str]` - `output: Optional[List[V2GoBackendInternalServiceOutputItem]]` - `id: Optional[str]` - `action: Optional[V2GoBackendInternalServiceAction]` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` - `call_id: Optional[str]` - `content: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `status: Optional[str]` - `summary: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]` - `"reasoning"` - `"computer_call"` - `"computer_call_output"` - `"message"` - `status: Optional[str]` - `temperature: Optional[float]` - `top_p: Optional[float]` - `usage: Optional[V2GoBackendInternalServiceResponsesUsage]` - `input_tokens: Optional[int]` - `output_tokens: Optional[int]` - `total_tokens: Optional[int]` - `viewport: Optional[V2GoBackendInternalServiceViewport]` - `environment: Optional[str]` - `height: Optional[int]` - `width: Optional[int]` ### V2 Go Backend Internal Service Action - `class V2GoBackendInternalServiceAction: …` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` ### V2 Go Backend Internal Service Output Item - `class V2GoBackendInternalServiceOutputItem: …` - `id: Optional[str]` - `action: Optional[V2GoBackendInternalServiceAction]` - `button: Optional[str]` - `end_x: Optional[int]` - `end_y: Optional[int]` - `keys: Optional[List[str]]` - `result: Optional[str]` - `scroll_x: Optional[int]` - `scroll_y: Optional[int]` - `status: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["click", "double_click", "triple_click", 14 more]]` - `"click"` - `"double_click"` - `"triple_click"` - `"right_click"` - `"type"` - `"key"` - `"keypress"` - `"key_down"` - `"key_up"` - `"scroll"` - `"hscroll"` - `"navigate"` - `"drag"` - `"wait"` - `"terminate"` - `"answer"` - `"done"` - `url: Optional[str]` - `x: Optional[int]` - `y: Optional[int]` - `call_id: Optional[str]` - `content: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `role: Optional[str]` - `status: Optional[str]` - `summary: Optional[List[ContentBlock]]` - `image_url: Optional[str]` - `text: Optional[str]` - `type: Optional[Literal["input_text", "output_text", "summary_text", "input_image"]]` - `"input_text"` - `"output_text"` - `"summary_text"` - `"input_image"` - `type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]` - `"reasoning"` - `"computer_call"` - `"computer_call_output"` - `"message"` ### V2 Go Backend Internal Service Responses Usage - `class V2GoBackendInternalServiceResponsesUsage: …` - `input_tokens: Optional[int]` - `output_tokens: Optional[int]` - `total_tokens: Optional[int]` ### V2 Go Backend Internal Service Viewport - `class V2GoBackendInternalServiceViewport: …` - `environment: Optional[str]` - `height: Optional[int]` - `width: Optional[int]`