KosmoKrator

data

Browserbase Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Browserbase KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.browserbase.*. Use lua_read_doc("integrations.browserbase") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Browserbase workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.browserbase.contexts_create({body = "example_body"}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("browserbase"))' --json
kosmo integrations:lua --eval 'print(docs.read("browserbase.contexts_create"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local browserbase = app.integrations.browserbase
local result = browserbase.contexts_create({body = "example_body"})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.browserbase, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.browserbase.default.* or app.integrations.browserbase.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Browserbase, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Browserbase Integration

Namespace: browserbase

This integration exposes Browserbase OpenAPI v1 operations as endpoint-specific tools. It was generated from https://docs.browserbase.com/reference/api/openapi.v1.yaml and uses the documented X-BB-API-Key header against https://api.browserbase.com.

JSON request bodies are passed through body. Multipart upload endpoints expose file as a local file path. Use list/get endpoints to discover IDs before updating sessions, contexts, extensions, downloads, functions, and invocations.

Coverage

  • Official paths: 28
  • Official operations: 34
  • Read operations: 22
  • Write operations: 12

Examples

local projects = browserbase.browserbase_projects_list({})
local session = browserbase.browserbase_sessions_create({ body = { projectId = "prj_example" } })
local search = browserbase.browserbase_search_web({ body = { query = "OpenCompany integrations", numResults = 5 } })

Tools

  • browserbase_contexts_create - POST /v1/contexts
  • browserbase_contexts_get - GET /v1/contexts/{id}
  • browserbase_contexts_update - PUT /v1/contexts/{id}
  • browserbase_contexts_delete - DELETE /v1/contexts/{id}
  • browserbase_downloads_list - GET /v1/downloads
  • browserbase_downloads_get - GET /v1/downloads/{id}
  • browserbase_downloads_delete - DELETE /v1/downloads/{id}
  • browserbase_extensions_upload - POST /v1/extensions
  • browserbase_extensions_get - GET /v1/extensions/{id}
  • browserbase_extensions_delete - DELETE /v1/extensions/{id}
  • browserbase_fetch_create - POST /v1/fetch
  • browserbase_functions_list - GET /v1/functions
  • browserbase_function_builds_list - GET /v1/functions/builds
  • browserbase_function_builds_get - GET /v1/functions/builds/{id}
  • browserbase_function_builds_get_logs - GET /v1/functions/builds/{id}/logs
  • browserbase_invocations_get - GET /v1/functions/invocations/{id}
  • browserbase_invocations_get_logs - GET /v1/functions/invocations/{id}/logs
  • browserbase_function_versions_get - GET /v1/functions/versions/{id}
  • browserbase_function_versions_list_invocations - GET /v1/functions/versions/{id}/invocations
  • browserbase_functions_get - GET /v1/functions/{id}
  • browserbase_functions_invoke - POST /v1/functions/{id}/invoke
  • browserbase_functions_list_versions - GET /v1/functions/{id}/versions
  • browserbase_projects_list - GET /v1/projects
  • browserbase_projects_get - GET /v1/projects/{id}
  • browserbase_projects_usage - GET /v1/projects/{id}/usage
  • browserbase_search_web - POST /v1/search
  • browserbase_sessions_list - GET /v1/sessions
  • browserbase_sessions_create - POST /v1/sessions
  • browserbase_sessions_get - GET /v1/sessions/{id}
  • browserbase_sessions_update - POST /v1/sessions/{id}
  • browserbase_sessions_get_debug - GET /v1/sessions/{id}/debug
  • browserbase_sessions_get_logs - GET /v1/sessions/{id}/logs
  • browserbase_sessions_get_recording - GET /v1/sessions/{id}/recording
  • browserbase_sessions_upload_file - POST /v1/sessions/{id}/uploads

All examples use fake IDs and safe placeholder values. Configure API keys through the host credential resolver, not in Lua source.

Raw agent markdown
# Browserbase Integration

Namespace: `browserbase`

This integration exposes Browserbase OpenAPI v1 operations as endpoint-specific tools. It was generated from `https://docs.browserbase.com/reference/api/openapi.v1.yaml` and uses the documented `X-BB-API-Key` header against `https://api.browserbase.com`.

JSON request bodies are passed through `body`. Multipart upload endpoints expose `file` as a local file path. Use list/get endpoints to discover IDs before updating sessions, contexts, extensions, downloads, functions, and invocations.

## Coverage

- Official paths: 28
- Official operations: 34
- Read operations: 22
- Write operations: 12

## Examples

```lua
local projects = browserbase.browserbase_projects_list({})
local session = browserbase.browserbase_sessions_create({ body = { projectId = "prj_example" } })
local search = browserbase.browserbase_search_web({ body = { query = "OpenCompany integrations", numResults = 5 } })
```

## Tools

- `browserbase_contexts_create` - POST /v1/contexts
- `browserbase_contexts_get` - GET /v1/contexts/{id}
- `browserbase_contexts_update` - PUT /v1/contexts/{id}
- `browserbase_contexts_delete` - DELETE /v1/contexts/{id}
- `browserbase_downloads_list` - GET /v1/downloads
- `browserbase_downloads_get` - GET /v1/downloads/{id}
- `browserbase_downloads_delete` - DELETE /v1/downloads/{id}
- `browserbase_extensions_upload` - POST /v1/extensions
- `browserbase_extensions_get` - GET /v1/extensions/{id}
- `browserbase_extensions_delete` - DELETE /v1/extensions/{id}
- `browserbase_fetch_create` - POST /v1/fetch
- `browserbase_functions_list` - GET /v1/functions
- `browserbase_function_builds_list` - GET /v1/functions/builds
- `browserbase_function_builds_get` - GET /v1/functions/builds/{id}
- `browserbase_function_builds_get_logs` - GET /v1/functions/builds/{id}/logs
- `browserbase_invocations_get` - GET /v1/functions/invocations/{id}
- `browserbase_invocations_get_logs` - GET /v1/functions/invocations/{id}/logs
- `browserbase_function_versions_get` - GET /v1/functions/versions/{id}
- `browserbase_function_versions_list_invocations` - GET /v1/functions/versions/{id}/invocations
- `browserbase_functions_get` - GET /v1/functions/{id}
- `browserbase_functions_invoke` - POST /v1/functions/{id}/invoke
- `browserbase_functions_list_versions` - GET /v1/functions/{id}/versions
- `browserbase_projects_list` - GET /v1/projects
- `browserbase_projects_get` - GET /v1/projects/{id}
- `browserbase_projects_usage` - GET /v1/projects/{id}/usage
- `browserbase_search_web` - POST /v1/search
- `browserbase_sessions_list` - GET /v1/sessions
- `browserbase_sessions_create` - POST /v1/sessions
- `browserbase_sessions_get` - GET /v1/sessions/{id}
- `browserbase_sessions_update` - POST /v1/sessions/{id}
- `browserbase_sessions_get_debug` - GET /v1/sessions/{id}/debug
- `browserbase_sessions_get_logs` - GET /v1/sessions/{id}/logs
- `browserbase_sessions_get_recording` - GET /v1/sessions/{id}/recording
- `browserbase_sessions_upload_file` - POST /v1/sessions/{id}/uploads

All examples use fake IDs and safe placeholder values. Configure API keys through the host credential resolver, not in Lua source.
Metadata-derived Lua example
local result = app.integrations.browserbase.contexts_create({body = "example_body"})
print(result)

Functions

contexts_create Read

Create a Context Official Browserbase endpoint: POST /v1/contexts.

Lua path
app.integrations.browserbase.contexts_create
Full name
browserbase.browserbase_contexts_create
ParameterTypeRequiredDescription
body object no JSON request body matching the official Browserbase OpenAPI schema.
contexts_get Read

Get a Context Official Browserbase endpoint: GET /v1/contexts/{id}.

Lua path
app.integrations.browserbase.contexts_get
Full name
browserbase.browserbase_contexts_get
ParameterTypeRequiredDescription
id string yes id
contexts_update Read

Update a Context Official Browserbase endpoint: PUT /v1/contexts/{id}.

Lua path
app.integrations.browserbase.contexts_update
Full name
browserbase.browserbase_contexts_update
ParameterTypeRequiredDescription
id string yes id
contexts_delete Read

Delete a Context Official Browserbase endpoint: DELETE /v1/contexts/{id}.

Lua path
app.integrations.browserbase.contexts_delete
Full name
browserbase.browserbase_contexts_delete
ParameterTypeRequiredDescription
id string yes id
downloads_list Read

List Downloads Official Browserbase endpoint: GET /v1/downloads.

Lua path
app.integrations.browserbase.downloads_list
Full name
browserbase.browserbase_downloads_list
ParameterTypeRequiredDescription
session_id string yes Filter downloads by session ID (required).
filename string no Filter by exact filename match.
mime_type string no Filter by MIME type.
min_size number no Minimum file size in bytes.
max_size number no Maximum file size in bytes.
created_after string no Filter downloads created on or after this timestamp.
created_before string no Filter downloads created on or before this timestamp.
limit number no Maximum number of results to return.
offset number no Number of results to skip for pagination.
downloads_get Read

Get a Download Official Browserbase endpoint: GET /v1/downloads/{id}.

Lua path
app.integrations.browserbase.downloads_get
Full name
browserbase.browserbase_downloads_get
ParameterTypeRequiredDescription
id string yes The download ID.
downloads_delete Read

Delete a Download Official Browserbase endpoint: DELETE /v1/downloads/{id}.

Lua path
app.integrations.browserbase.downloads_delete
Full name
browserbase.browserbase_downloads_delete
ParameterTypeRequiredDescription
id string yes The download ID to delete.
extensions_upload Read

Upload an Extension Official Browserbase endpoint: POST /v1/extensions.

Lua path
app.integrations.browserbase.extensions_upload
Full name
browserbase.browserbase_extensions_upload
ParameterTypeRequiredDescription
file string yes file Provide a local file path for upload.
extensions_get Read

Get an Extension Official Browserbase endpoint: GET /v1/extensions/{id}.

Lua path
app.integrations.browserbase.extensions_get
Full name
browserbase.browserbase_extensions_get
ParameterTypeRequiredDescription
id string yes id
extensions_delete Read

Delete an Extension Official Browserbase endpoint: DELETE /v1/extensions/{id}.

Lua path
app.integrations.browserbase.extensions_delete
Full name
browserbase.browserbase_extensions_delete
ParameterTypeRequiredDescription
id string yes id
fetch_create Read

Fetch a Page Official Browserbase endpoint: POST /v1/fetch.

Lua path
app.integrations.browserbase.fetch_create
Full name
browserbase.browserbase_fetch_create
ParameterTypeRequiredDescription
body object yes JSON request body matching the official Browserbase OpenAPI schema.
functions_list Read

List Functions Official Browserbase endpoint: GET /v1/functions.

Lua path
app.integrations.browserbase.functions_list
Full name
browserbase.browserbase_functions_list
ParameterTypeRequiredDescription
offset integer no offset
limit integer no limit
function_builds_list Read

List Function Builds Official Browserbase endpoint: GET /v1/functions/builds.

Lua path
app.integrations.browserbase.function_builds_list
Full name
browserbase.browserbase_function_builds_list
ParameterTypeRequiredDescription
offset integer no offset
limit integer no limit
status string no status
function_builds_get Read

Get a Function Build Official Browserbase endpoint: GET /v1/functions/builds/{id}.

Lua path
app.integrations.browserbase.function_builds_get
Full name
browserbase.browserbase_function_builds_get
ParameterTypeRequiredDescription
id string yes id
function_builds_get_logs Read

Get Function Build Logs Official Browserbase endpoint: GET /v1/functions/builds/{id}/logs.

Lua path
app.integrations.browserbase.function_builds_get_logs
Full name
browserbase.browserbase_function_builds_get_logs
ParameterTypeRequiredDescription
id string yes id
invocations_get Read

Get an Invocation Official Browserbase endpoint: GET /v1/functions/invocations/{id}.

Lua path
app.integrations.browserbase.invocations_get
Full name
browserbase.browserbase_invocations_get
ParameterTypeRequiredDescription
id string yes id
invocations_get_logs Read

Get Invocation Logs Official Browserbase endpoint: GET /v1/functions/invocations/{id}/logs.

Lua path
app.integrations.browserbase.invocations_get_logs
Full name
browserbase.browserbase_invocations_get_logs
ParameterTypeRequiredDescription
id string yes id
function_versions_get Read

Get a Function Version Official Browserbase endpoint: GET /v1/functions/versions/{id}.

Lua path
app.integrations.browserbase.function_versions_get
Full name
browserbase.browserbase_function_versions_get
ParameterTypeRequiredDescription
id string yes id
function_versions_list_invocations Read

List Invocations for a Function Version Official Browserbase endpoint: GET /v1/functions/versions/{id}/invocations.

Lua path
app.integrations.browserbase.function_versions_list_invocations
Full name
browserbase.browserbase_function_versions_list_invocations
ParameterTypeRequiredDescription
offset integer no offset
limit integer no limit
status string no status
id string yes id
functions_get Read

Get a Function Official Browserbase endpoint: GET /v1/functions/{id}.

Lua path
app.integrations.browserbase.functions_get
Full name
browserbase.browserbase_functions_get
ParameterTypeRequiredDescription
id string yes id
functions_invoke Read

Invoke a Function Official Browserbase endpoint: POST /v1/functions/{id}/invoke.

Lua path
app.integrations.browserbase.functions_invoke
Full name
browserbase.browserbase_functions_invoke
ParameterTypeRequiredDescription
id string yes id
body object no JSON request body matching the official Browserbase OpenAPI schema.
functions_list_versions Read

List Function Versions Official Browserbase endpoint: GET /v1/functions/{id}/versions.

Lua path
app.integrations.browserbase.functions_list_versions
Full name
browserbase.browserbase_functions_list_versions
ParameterTypeRequiredDescription
offset integer no offset
limit integer no limit
id string yes id
projects_list Read

List Projects Official Browserbase endpoint: GET /v1/projects.

Lua path
app.integrations.browserbase.projects_list
Full name
browserbase.browserbase_projects_list
ParameterTypeRequiredDescription
No parameters.
projects_get Read

Get a Project Official Browserbase endpoint: GET /v1/projects/{id}.

Lua path
app.integrations.browserbase.projects_get
Full name
browserbase.browserbase_projects_get
ParameterTypeRequiredDescription
id string yes id
projects_usage Read

Get Project Usage Official Browserbase endpoint: GET /v1/projects/{id}/usage.

Lua path
app.integrations.browserbase.projects_usage
Full name
browserbase.browserbase_projects_usage
ParameterTypeRequiredDescription
id string yes id
search_web Read

Web Search Official Browserbase endpoint: POST /v1/search.

Lua path
app.integrations.browserbase.search_web
Full name
browserbase.browserbase_search_web
ParameterTypeRequiredDescription
body object yes JSON request body matching the official Browserbase OpenAPI schema.
sessions_list Read

List Sessions Official Browserbase endpoint: GET /v1/sessions.

Lua path
app.integrations.browserbase.sessions_list
Full name
browserbase.browserbase_sessions_list
ParameterTypeRequiredDescription
status string no status
q string no Query sessions by user metadata. See [Querying Sessions by User Metadata](/features/sessions#querying-sessions-by-user-metadata) for the schema of this query.
sessions_create Read

Create a Session Official Browserbase endpoint: POST /v1/sessions.

Lua path
app.integrations.browserbase.sessions_create
Full name
browserbase.browserbase_sessions_create
ParameterTypeRequiredDescription
body object no JSON request body matching the official Browserbase OpenAPI schema.
sessions_get Read

Get a Session Official Browserbase endpoint: GET /v1/sessions/{id}.

Lua path
app.integrations.browserbase.sessions_get
Full name
browserbase.browserbase_sessions_get
ParameterTypeRequiredDescription
id string yes id
sessions_update Read

Update a Session Official Browserbase endpoint: POST /v1/sessions/{id}.

Lua path
app.integrations.browserbase.sessions_update
Full name
browserbase.browserbase_sessions_update
ParameterTypeRequiredDescription
id string yes id
body object yes JSON request body matching the official Browserbase OpenAPI schema.
sessions_get_debug Read

Session Live URLs Official Browserbase endpoint: GET /v1/sessions/{id}/debug.

Lua path
app.integrations.browserbase.sessions_get_debug
Full name
browserbase.browserbase_sessions_get_debug
ParameterTypeRequiredDescription
id string yes id
sessions_get_logs Read

Session Logs Official Browserbase endpoint: GET /v1/sessions/{id}/logs.

Lua path
app.integrations.browserbase.sessions_get_logs
Full name
browserbase.browserbase_sessions_get_logs
ParameterTypeRequiredDescription
id string yes id
sessions_get_recording Read

Session Recording Official Browserbase endpoint: GET /v1/sessions/{id}/recording.

Lua path
app.integrations.browserbase.sessions_get_recording
Full name
browserbase.browserbase_sessions_get_recording
ParameterTypeRequiredDescription
id string yes id
sessions_upload_file Read

Create Session Uploads Official Browserbase endpoint: POST /v1/sessions/{id}/uploads.

Lua path
app.integrations.browserbase.sessions_upload_file
Full name
browserbase.browserbase_sessions_upload_file
ParameterTypeRequiredDescription
id string yes id
file string yes file Provide a local file path for upload.