Skip to content
Dashboard

Create a new response

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.

ParametersExpand Collapse
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"]]
One of the following:
"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"]]
One of the following:
"input_text"
"output_text"
"summary_text"
"input_image"
role: Optional[str]
type: Optional[Literal["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"]]
top_p: Optional[float]
ReturnsExpand Collapse
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]]
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: 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"]]
One of the following:
"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"]]
One of the following:
"input_text"
"output_text"
"summary_text"
"input_image"
type: Optional[Literal["reasoning", "computer_call", "computer_call_output", "message"]]
One of the following:
"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]

Create a new response

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)
{
  "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
  }
}