API Reference
The AGENSTAB API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Authentication
Authenticate your API requests using a Bearer token in the HTTP Authorization header. Manage your API keys in the AGENSTAB Dashboard.
import requests headers = { "Authorization": "Bearer sk_live_...", "Content-Type": "application/json" }
Create Session
Initializes a new isolated V8 browsing session in our edge network. Returns a unique session ID required for all subsequent interactions.
Parameters
- tier string (optional)
The compute tier to use ('standard', 'elite'). Default: standard. - region string (optional)
Preferred edge region (e.g., 'us-east-1').
response = requests.post(
"https://api.agenstab.com/v1/sessions",
json={"tier": "elite"},
headers=headers
)
print(response.json())
# {"session_id": "ses_123abc"}
Semantic Interact
Executes a deterministic state transition using the semantic representation. Bypasses visual rendering and interfaces directly with the Chromium Accessibility Tree.
Parameters
- agent_id string (required)
The stable semantic identifier mapped during extraction. - action_type string (required)
e.g., 'semantic_click', 'type'.
url = "https://api.agenstab.com/v1/sessions/ses_abc123/interact" payload = { "agent_id": "submit_btn", "action_type": "semantic_click" } requests.post(url, json=payload, headers=headers)
agent := agenstab.New(agenstab.Config{ URL: "ws://localhost:8080/v1/session", }) agent.Click("submit_btn")
Session Configuration
Advanced session parameters available via browser.create_session.
Parameters
- token_ttl integer (optional, default: 3600)
Session expiration in seconds. Session is forcefully terminated after this duration. - hitl_transaction_threshold integer (optional, default: 10000)
Threshold in cents. When a click targets a payment-related element, the session auto-pauses and emits error-32009. - max_elements integer (optional, default: 50)
Maximum number of elements returned bybrowser.observe. Controls LLM context budget. - focus_id string (optional)
Anagent_idto prioritize. Elements near this ID receive higher relevance scores. - stealth_mode boolean (optional, default: false)
Enables advanced browser fingerprint evasion (Canvas noise, WebGL spoofing). - domain_allowlist array (optional)
Restrict navigation to specified domains. Supports wildcards (e.g.,*.salesforce.com).
agent.CreateSession(agenstab.SessionConfig{
TokenTTL: 3600,
HitlTransactionThreshold: 10000,
StealthMode: true,
})
Error Codes
All errors follow JSON-RPC 2.0 format. The error.code field identifies the specific failure.
| Code | Name | Description |
|---|---|---|
| -32001 | ELEMENT_NOT_FOUND | No mapped element for the given agent_id. |
| -32002 | PERMISSION_DENIED | Action blocked by session policy (e.g., allow_js_eval=false). |
| -32003 | DOMAIN_RESTRICTED | Navigation target is not in the session's domain_allowlist. |
| -32004 | INTERSTITIAL_BLOCKED | A modal, popup, or overlay is blocking the target element. |
| -32005 | SESSION_EXPIRED | Session has been terminated or token_ttl has elapsed. |
| -32006 | RATE_LIMIT_EXCEEDED | Actions per minute limit (600 APM) breached. |
| -32007 | NAVIGATION_TIMEOUT | Page failed to load within the configured timeout. |
| -32008 | VLM_GROUNDING_FAILED | Tier 3 visual grounding failed or GDPR redaction blocked cloud VLM. |
| -32009 | HITL_THRESHOLD_EXCEEDED | High-value transaction detected. Session paused for human review. |