Skip to main content
GET
/
v1
/
sessions
/
{session_id}
Get Session
curl --request GET \
  --url https://api.example.com/v1/sessions/{session_id} \
  --header 'Authorization: <authorization>'
{
  "session_id": "f6a7b0e6-7f46-4a0d-9a47-92b7f0a4d2d3",
  "vnc_url": "https://vnc.agi.tech/session/f6a7b0e6...",
  "agent_name": "agi-0",
  "status": "running",
  "created_at": "2025-10-05T18:04:34.281Z"
}

Overview

Retrieves detailed information about a specific session by its ID.

Request

session_id
string
required
The UUID of the session to retrieve
Authorization
string
required
Bearer token for authentication

Response

session_id
string
required
Unique identifier for the session
vnc_url
string
URL to view the agent’s browser
agent_name
string
required
The agent model being used
status
string
required
Current session status
created_at
string
required
ISO 8601 timestamp of session creation
{
  "session_id": "f6a7b0e6-7f46-4a0d-9a47-92b7f0a4d2d3",
  "vnc_url": "https://vnc.agi.tech/session/f6a7b0e6...",
  "agent_name": "agi-0",
  "status": "running",
  "created_at": "2025-10-05T18:04:34.281Z"
}

Example Requests

curl https://api.agi.tech/v1/sessions/f6a7b0e6-7f46-4a0d-9a47-92b7f0a4d2d3 \
  -H "Authorization: Bearer $AGI_API_KEY"

Error Responses

404
error
Session not found or not owned by authenticated user

Use Cases

Verify Session Exists

Check if a session is still available before sending messages:
try:
    session = get_session(session_id)
    if session['status'] not in ['error', 'terminated']:
        send_message(session_id, "Continue task...")
except requests.HTTPError as e:
    if e.response.status_code == 404:
        print("Session no longer exists")

Get VNC URL

Retrieve the VNC URL to share with team members for debugging:
session = get_session(session_id)
vnc_url = session.get('vnc_url')
print(f"Watch the agent at: {vnc_url}")