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.
Parameters
instructions: Optional[str]
max_output_tokens: Optional[int]
model: Optional[str]
previous_response_id: Optional[str]
temperature: Optional[float]
top_p: Optional[float]
Returns
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
}
}