KosmoKrator

media

Abyssale Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.abyssale.*. Use lua_read_doc("integrations.abyssale") 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.

Abyssale — Lua API Reference

list_generations

List image generation jobs with optional pagination and status filter.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (1-based, default: 1)
limitintegernoResults per page (default: 20, max: 100)
statusstringnoFilter by status: "finished", "processing", or "failed"

Example

local result = app.integrations.abyssale.list_generations({
  page = 1,
  limit = 10,
  status = "finished"
})

for _, gen in ipairs(result.generations) do
  print(gen.id .. ": " .. gen.status)
end

get_generation

Get details of a specific image generation.

Parameters

NameTypeRequiredDescription
idstringyesThe generation UUID

Example

local result = app.integrations.abyssale.get_generation({
  id = "gen_abc123"
})

print("Status: " .. result.status)
print("Outputs:")
for _, output in ipairs(result.outputs) do
  print("  " .. output.url)
end

create_generation

Generate images from a template with custom modifications.

Parameters

NameTypeRequiredDescription
template_idstringyesThe template UUID
format_idsarrayyesArray of format UUIDs to generate
modificationsobjectnoElement modifications (keys = element names, values = override objects)

Modifications Syntax

Each key in the modifications object corresponds to an element name in the template. The value defines the override:

modifications = {
  title = { payload = "New Headline" },
  subtitle = { payload = "Updated subtitle text" },
  background = { payload = "https://example.com/bg.jpg" }
}

Example

local result = app.integrations.abyssale.create_generation({
  template_id = "tmpl_abc123",
  format_ids = { "fmt_facebook_post", "fmt_instagram_square" },
  modifications = {
    headline = { payload = "Summer Sale 50% Off" },
    cta_text = { payload = "Shop Now" },
    product_image = { payload = "https://example.com/product.jpg" }
  }
})

print("Generation ID: " .. result.id)
print("Status: " .. result.status)

list_templates

List available design templates.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (1-based, default: 1)
limitintegernoResults per page (default: 20, max: 100)

Example

local result = app.integrations.abyssale.list_templates({
  page = 1,
  limit = 10
})

for _, tmpl in ipairs(result.templates) do
  print(tmpl.id .. ": " .. tmpl.name)
end

get_template

Get details of a specific template, including its formats and editable elements.

Parameters

NameTypeRequiredDescription
idstringyesThe template UUID

Example

local result = app.integrations.abyssale.get_template({
  id = "tmpl_abc123"
})

print("Template: " .. result.name)
print("Formats:")
for _, fmt in ipairs(result.formats) do
  print("  " .. fmt.id .. " (" .. fmt.width .. "x" .. fmt.height .. ")")
end

list_formats

List available output formats (sizes and dimensions).

Parameters

NameTypeRequiredDescription
pageintegernoPage number (1-based, default: 1)
limitintegernoResults per page (default: 20, max: 100)

Example

local result = app.integrations.abyssale.list_formats({
  limit = 50
})

for _, fmt in ipairs(result.formats) do
  print(fmt.id .. ": " .. fmt.name .. " (" .. fmt.width .. "x" .. fmt.height .. ")")
end

get_current_user

Get the profile of the currently authenticated user.

Parameters

None.

Example

local result = app.integrations.abyssale.get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.abyssale.function_name({...})

-- Explicit default (portable across setups)
app.integrations.abyssale.default.function_name({...})

-- Named accounts
app.integrations.abyssale.production.function_name({...})
app.integrations.abyssale.staging.function_name({...})

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

Raw agent markdown
# Abyssale — Lua API Reference

## list_generations

List image generation jobs with optional pagination and status filter.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (1-based, default: 1) |
| `limit` | integer | no | Results per page (default: 20, max: 100) |
| `status` | string | no | Filter by status: `"finished"`, `"processing"`, or `"failed"` |

### Example

```lua
local result = app.integrations.abyssale.list_generations({
  page = 1,
  limit = 10,
  status = "finished"
})

for _, gen in ipairs(result.generations) do
  print(gen.id .. ": " .. gen.status)
end
```

---

## get_generation

Get details of a specific image generation.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The generation UUID |

### Example

```lua
local result = app.integrations.abyssale.get_generation({
  id = "gen_abc123"
})

print("Status: " .. result.status)
print("Outputs:")
for _, output in ipairs(result.outputs) do
  print("  " .. output.url)
end
```

---

## create_generation

Generate images from a template with custom modifications.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `template_id` | string | yes | The template UUID |
| `format_ids` | array | yes | Array of format UUIDs to generate |
| `modifications` | object | no | Element modifications (keys = element names, values = override objects) |

### Modifications Syntax

Each key in the modifications object corresponds to an element name in the template. The value defines the override:

```lua
modifications = {
  title = { payload = "New Headline" },
  subtitle = { payload = "Updated subtitle text" },
  background = { payload = "https://example.com/bg.jpg" }
}
```

### Example

```lua
local result = app.integrations.abyssale.create_generation({
  template_id = "tmpl_abc123",
  format_ids = { "fmt_facebook_post", "fmt_instagram_square" },
  modifications = {
    headline = { payload = "Summer Sale 50% Off" },
    cta_text = { payload = "Shop Now" },
    product_image = { payload = "https://example.com/product.jpg" }
  }
})

print("Generation ID: " .. result.id)
print("Status: " .. result.status)
```

---

## list_templates

List available design templates.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (1-based, default: 1) |
| `limit` | integer | no | Results per page (default: 20, max: 100) |

### Example

```lua
local result = app.integrations.abyssale.list_templates({
  page = 1,
  limit = 10
})

for _, tmpl in ipairs(result.templates) do
  print(tmpl.id .. ": " .. tmpl.name)
end
```

---

## get_template

Get details of a specific template, including its formats and editable elements.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The template UUID |

### Example

```lua
local result = app.integrations.abyssale.get_template({
  id = "tmpl_abc123"
})

print("Template: " .. result.name)
print("Formats:")
for _, fmt in ipairs(result.formats) do
  print("  " .. fmt.id .. " (" .. fmt.width .. "x" .. fmt.height .. ")")
end
```

---

## list_formats

List available output formats (sizes and dimensions).

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (1-based, default: 1) |
| `limit` | integer | no | Results per page (default: 20, max: 100) |

### Example

```lua
local result = app.integrations.abyssale.list_formats({
  limit = 50
})

for _, fmt in ipairs(result.formats) do
  print(fmt.id .. ": " .. fmt.name .. " (" .. fmt.width .. "x" .. fmt.height .. ")")
end
```

---

## get_current_user

Get the profile of the currently authenticated user.

### Parameters

None.

### Example

```lua
local result = app.integrations.abyssale.get_current_user({})
print("User: " .. result.first_name .. " " .. result.last_name)
print("Email: " .. result.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.abyssale.function_name({...})

-- Explicit default (portable across setups)
app.integrations.abyssale.default.function_name({...})

-- Named accounts
app.integrations.abyssale.production.function_name({...})
app.integrations.abyssale.staging.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.abyssale.abyssale_list_generations({
  page = 1,
  limit = 1,
  status = "example_status"
})
print(result)

Functions

abyssale_list_generations

List image generation jobs from Abyssale. Returns a paginated list of generations, optionally filtered by status (e.g., "finished", "processing", "failed").

Operation
Read read
Full name
abyssale.abyssale_list_generations
ParameterTypeRequiredDescription
page integer no Page number (1-based, default: 1).
limit integer no Results per page (default: 20, max: 100).
status string no Filter by generation status: "finished", "processing", or "failed".

abyssale_get_generation

Get details of a specific image generation from Abyssale, including its status, output URLs, and applied modifications.

Operation
Read read
Full name
abyssale.abyssale_get_generation
ParameterTypeRequiredDescription
id string yes The generation UUID.

abyssale_create_generation

Generate images from an Abyssale template. Specify the template, one or more output format IDs, and element modifications (text, images, colors) to customize the output.

Operation
Write write
Full name
abyssale.abyssale_create_generation
ParameterTypeRequiredDescription
template_id string yes The template UUID to generate from.
format_ids array yes Array of format UUIDs to generate (e.g., ["fmt_abc123", "fmt_def456"]). Use abyssale_list_formats to discover available formats.
modifications object no Element modifications as a JSON object. Keys are element names, values define overrides (e.g., {"title": {"payload": "New Headline"}, "background": {"payload": "https://example.com/bg.jpg"}}).

abyssale_list_templates

List available design templates from Abyssale. Returns a paginated list of templates with their IDs and names.

Operation
Read read
Full name
abyssale.abyssale_list_templates
ParameterTypeRequiredDescription
page integer no Page number (1-based, default: 1).
limit integer no Results per page (default: 20, max: 100).

abyssale_get_template

Get details of a specific Abyssale template, including its available formats, elements, and layers that can be modified.

Operation
Read read
Full name
abyssale.abyssale_get_template
ParameterTypeRequiredDescription
id string yes The template UUID.

abyssale_list_formats

List available output formats from Abyssale. Formats define the size and dimensions of generated images (e.g., 1200x628 Facebook post, 1080x1080 Instagram square).

Operation
Read read
Full name
abyssale.abyssale_list_formats
ParameterTypeRequiredDescription
page integer no Page number (1-based, default: 1).
limit integer no Results per page (default: 20, max: 100).

abyssale_get_current_user

Get the profile of the currently authenticated Abyssale user. Useful for verifying API credentials and retrieving account information.

Operation
Read read
Full name
abyssale.abyssale_get_current_user
ParameterTypeRequiredDescription
No parameters.