KosmoKrator

productivity

Paperspace Lua API for KosmoKrator Agents

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

7 functions 7 read 0 write Bearer token auth

Lua Namespace

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

Agent-Facing Lua Docs

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

Paperspace — Lua API Reference

list_machines

List all GPU machines in the account.

Parameters

None.

Example

local result = app.integrations.paperspace.list_machines({})

for _, machine in ipairs(result) do
  print(machine.name .. " (" .. machine.state .. ") - " .. machine.machineType)
end

get_machine

Get details for a specific machine.

Parameters

NameTypeRequiredDescription
machine_idstringyesThe machine ID

Example

local result = app.integrations.paperspace.get_machine({ machine_id = "psabc123" })
local m = result
print(m.name .. " - " .. m.os .. " - " .. m.publicIp)

list_notebooks

List all Gradient notebooks in the account.

Parameters

None.

Example

local result = app.integrations.paperspace.list_notebooks({})

for _, notebook in ipairs(result) do
  print(notebook.name .. " (" .. notebook.state .. ")")
end

list_datasets

List all datasets in the account.

Parameters

None.

Example

local result = app.integrations.paperspace.list_datasets({})

for _, dataset in ipairs(result) do
  print(dataset.name .. " - " .. (dataset.size or "unknown size"))
end

list_projects

List all Gradient projects in the account.

Parameters

None.

Example

local result = app.integrations.paperspace.list_projects({})

for _, project in ipairs(result) do
  print(project.name .. " - " .. (project.description or "no description"))
end

list_ssh_keys

List all SSH keys in the account.

Parameters

None.

Example

local result = app.integrations.paperspace.list_ssh_keys({})

for _, key in ipairs(result) do
  print(key.name .. " - " .. key.fingerprint)
end

get_current_user

Get the current authenticated user information.

Parameters

None.

Example

local result = app.integrations.paperspace.get_current_user({})
print("User: " .. result.email .. " (ID: " .. result.id .. ")")

Multi-Account Usage

If you have multiple Paperspace accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.paperspace.list_machines({})

-- Explicit default (portable across setups)
app.integrations.paperspace.default.list_machines({})

-- Named accounts
app.integrations.paperspace.production.list_machines({})
app.integrations.paperspace.staging.list_machines({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Paperspace — Lua API Reference

## list_machines

List all GPU machines in the account.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.list_machines({})

for _, machine in ipairs(result) do
  print(machine.name .. " (" .. machine.state .. ") - " .. machine.machineType)
end
```

---

## get_machine

Get details for a specific machine.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `machine_id` | string | yes | The machine ID |

### Example

```lua
local result = app.integrations.paperspace.get_machine({ machine_id = "psabc123" })
local m = result
print(m.name .. " - " .. m.os .. " - " .. m.publicIp)
```

---

## list_notebooks

List all Gradient notebooks in the account.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.list_notebooks({})

for _, notebook in ipairs(result) do
  print(notebook.name .. " (" .. notebook.state .. ")")
end
```

---

## list_datasets

List all datasets in the account.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.list_datasets({})

for _, dataset in ipairs(result) do
  print(dataset.name .. " - " .. (dataset.size or "unknown size"))
end
```

---

## list_projects

List all Gradient projects in the account.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.list_projects({})

for _, project in ipairs(result) do
  print(project.name .. " - " .. (project.description or "no description"))
end
```

---

## list_ssh_keys

List all SSH keys in the account.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.list_ssh_keys({})

for _, key in ipairs(result) do
  print(key.name .. " - " .. key.fingerprint)
end
```

---

## get_current_user

Get the current authenticated user information.

### Parameters

None.

### Example

```lua
local result = app.integrations.paperspace.get_current_user({})
print("User: " .. result.email .. " (ID: " .. result.id .. ")")
```

---

## Multi-Account Usage

If you have multiple Paperspace accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.paperspace.list_machines({})

-- Explicit default (portable across setups)
app.integrations.paperspace.default.list_machines({})

-- Named accounts
app.integrations.paperspace.production.list_machines({})
app.integrations.paperspace.staging.list_machines({})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.paperspace.paperspace_list_machines({})
print(result)

Functions

paperspace_list_machines

List all GPU machines in the Paperspace account. Returns IDs, names, OS, machine type, state, and public IP address.

Operation
Read read
Full name
paperspace.paperspace_list_machines
ParameterTypeRequiredDescription
No parameters.

paperspace_get_machine

Get details for a specific Paperspace machine by ID. Returns full machine information including specs, state, and network configuration.

Operation
Read read
Full name
paperspace.paperspace_get_machine
ParameterTypeRequiredDescription
machine_id string yes The machine ID.

paperspace_list_notebooks

List all Gradient notebooks in the Paperspace account. Returns notebook IDs, names, cluster, machine type, and state.

Operation
Read read
Full name
paperspace.paperspace_list_notebooks
ParameterTypeRequiredDescription
No parameters.

paperspace_list_datasets

List all datasets in the Paperspace account. Returns dataset IDs, names, storage usage, and creation dates.

Operation
Read read
Full name
paperspace.paperspace_list_datasets
ParameterTypeRequiredDescription
No parameters.

paperspace_list_projects

List all Gradient projects in the Paperspace account. Returns project IDs, names, descriptions, and creation dates.

Operation
Read read
Full name
paperspace.paperspace_list_projects
ParameterTypeRequiredDescription
No parameters.

paperspace_list_ssh_keys

List all SSH keys in the Paperspace account. Returns key IDs, names, and fingerprints.

Operation
Read read
Full name
paperspace.paperspace_list_ssh_keys
ParameterTypeRequiredDescription
No parameters.

paperspace_get_current_user

Get information about the current authenticated Paperspace user, including email, user ID, and team membership.

Operation
Read read
Full name
paperspace.paperspace_get_current_user
ParameterTypeRequiredDescription
No parameters.