Skip to main content
GET
/
sandbox
/
logs
Python
from acontext import AcontextClient

client = AcontextClient(api_key='sk_project_token')

# Get sandbox logs
logs = client.sandboxes.get_logs(limit=20, time_desc=True)
for log in logs.items:
    print(f"Log {log.id}: {log.backend_type}")

# If there are more logs, use the cursor for pagination
if logs.has_more:
    next_logs = client.sandboxes.get_logs(
        limit=20,
        cursor=logs.next_cursor
    )
{
  "code": 123,
  "error": "<string>",
  "msg": "<string>",
  "data": {
    "has_more": true,
    "items": [
      {
        "backend_sandbox_id": "<string>",
        "backend_type": "<string>",
        "created_at": "<string>",
        "generated_files": [
          {}
        ],
        "history_commands": [
          {}
        ],
        "id": "<string>",
        "project_id": "<string>",
        "updated_at": "<string>",
        "will_total_alive_seconds": 123
      }
    ],
    "next_cursor": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

Query Parameters

limit
integer

Limit of sandbox logs to return, default 20. Max 200.

cursor
string

Cursor for pagination. Use the cursor from the previous response to get the next page.

time_desc
boolean

Order by created_at descending if true, ascending if false (default false)

Response

200 - application/json

OK

code
integer
error
string
msg
string
data
object