Setting up
Get your free API key and start running tasks in minutes.Get your free API key
Unlock your free welcome credits. No credit card required.
Launch a task using the Python SDK
Launch your first task in 4 lines of code.If Python is not your language of choice, check out our API Reference.
Request
All parameters available when running a task.The task for the agent to execute.Example:
Go to Google Flights and find the cheapest flight from London to Paris today
If provided, enforces a specific output structure.
It can either be a dictionary describing a JSON schema or a Pydantic Model.
Default:
None
.Example:If you set
response_model
, Smooth will see it, no need to include it in task
.The agent that will run the task. Currently, only
smooth
is available. Default: smooth
.Example: smooth
The browser session ID to be utilized. Each session retains its own state, including login credentials and cookies.Example:
session_12345
The upper limit on the number of steps the agent can take during task execution. The range is from 2 to 64. Default: 32.Example:
64
The type of device for the task execution. Choose between
mobile
or desktop
. Default: mobile
.Example: desktop
The starting URL for the task. If not provided, the agent will infer it from the task.Example:
https://amazon.com
A dictionary containing variables or parameters that will be passed to the agent.Example:
{"username": "my_username"}
The agent that will run the task. Currently, only
smooth
is available. Default: smooth
.Example: smooth
Toggles the option to record a video of the task execution. Default: False.Example:
True
Activates stealth mode for the browser, which helps in avoiding detection. Default: False.Example:
True
The hostname or IP address of the proxy server that will be used for the session.Example:
proxy.example.com
The username for authenticating with the proxy server, if authentication is required.Example:
user123
The password for authenticating with the proxy server, if authentication is required.Example:
password123
Response
Returns aTaskHandle
with the following attributes.
Returns the ID of the task.
Returns a live URL where you can see the agent in action.Set
interactive=True
to get an interactive view.Set embed=True
to get an embeddable view (ideal for iframes).Waits for the task completion and returns a
TaskResponse
upon completion.Waits for the task completion and returns a recording URL upon completion. You can use this link to download the video recording of the task. The video will be ready shortly after the task completes.
TaskResponse
contains also live_url
and recording_url
to be compatible with the API structure.
Use TaskHandle.live_url()
and TaskHandle.recording_url()
as they handle the underlying API polling for you.Waiting for task completion
Useresult()
to wait for task completion.
TaskResponse
with the following attributes.
The ID of the task.
The status of the task. One of: [“waiting”, “running”, “done”, “failed”]
The final response from the agent.
The number of credits used. 1 credit corresponds to $0.01.
The device type used for the task. One of: [“mobile”, “desktop”]
Structured output
Smooth supports structured output, simply set theresponse_model
field by passing either a Pydantic Model or a JSON schema.