KosmoKrator

productivity

Cerebras Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.cerebras.*. Use lua_read_doc("integrations.cerebras") 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 Cerebras workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.cerebras.cancel_batch({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("cerebras"))' --json
kosmo integrations:lua --eval 'print(docs.read("cerebras.cancel_batch"))' --json

Workflow file

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

workflow.lua
local cerebras = app.integrations.cerebras
local result = cerebras.cancel_batch({})

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.cerebras, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.cerebras.default.* or app.integrations.cerebras.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Cerebras, 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.

Cerebras

Namespace: cerebras

Cerebras provides ultra-fast OpenAI-compatible inference plus preview APIs for batches, files, metrics, and dedicated endpoint/model management.

Default API URL: https://api.cerebras.ai

Metrics use the documented Cloud URL: https://cloud.cerebras.ai/api/v1/metrics/organizations/{organization_id}.

Usage notes

  • cerebras_chat_completions and cerebras_completions accept a body object matching the Cerebras API schema.
  • Batch tools map /v1/batches and currently support the documented /v1/chat/completions batch endpoint.
  • File upload uses file_path plus optional multipart body fields such as purpose.
  • Public model tools do not require path account IDs and support optional query.format values such as openrouter or huggingface.
  • Dedicated endpoint management tools use /management/v1/... paths and are intended for accounts with the preview management API enabled.

Tools

  • cerebras_chat_completions, cerebras_completions
  • cerebras_list_models, cerebras_retrieve_model
  • cerebras_list_public_models, cerebras_retrieve_public_model
  • cerebras_create_batch, cerebras_list_batches, cerebras_retrieve_batch, cerebras_cancel_batch
  • cerebras_upload_file, cerebras_list_files, cerebras_retrieve_file, cerebras_retrieve_file_content, cerebras_delete_file
  • cerebras_retrieve_metrics
  • cerebras_list_model_architectures, cerebras_list_model_versions, cerebras_upload_model_version, cerebras_retrieve_model_version_status, cerebras_delete_model_version, cerebras_update_model_version_aliases
  • cerebras_list_endpoints, cerebras_retrieve_endpoint_status, cerebras_deploy_model_to_endpoint

Examples

Chat completion:

local response = cerebras_chat_completions({
  body = {
    model = "gpt-oss-120b",
    messages = {
      { role = "user", content = "Write a short release note." }
    }
  }
})

List public models in OpenRouter format:

local models = cerebras_list_public_models({
  query = { format = "openrouter" }
})

Upload a batch file:

local uploaded = cerebras_upload_file({
  file_path = "/tmp/cerebras-batch.jsonl",
  body = { purpose = "batch" }
})

Retrieve endpoint metrics:

local metrics = cerebras_retrieve_metrics({
  organization_id = "org_abc123"
})

Coverage notes

This package covers the endpoint inventory published in the Cerebras docs index at implementation time: inference, completions, models, public models, batch, files, metrics, and the customer management OpenAPI spec. Non-endpoint guide pages such as authentication, versions, capabilities, and cookbooks are covered by docs, not executable tools.

Raw agent markdown
# Cerebras

Namespace: `cerebras`

Cerebras provides ultra-fast OpenAI-compatible inference plus preview APIs for
batches, files, metrics, and dedicated endpoint/model management.

Default API URL: `https://api.cerebras.ai`

Metrics use the documented Cloud URL:
`https://cloud.cerebras.ai/api/v1/metrics/organizations/{organization_id}`.

## Usage notes

- `cerebras_chat_completions` and `cerebras_completions` accept a `body` object
  matching the Cerebras API schema.
- Batch tools map `/v1/batches` and currently support the documented
  `/v1/chat/completions` batch endpoint.
- File upload uses `file_path` plus optional multipart `body` fields such as
  `purpose`.
- Public model tools do not require path account IDs and support optional
  `query.format` values such as `openrouter` or `huggingface`.
- Dedicated endpoint management tools use `/management/v1/...` paths and are
  intended for accounts with the preview management API enabled.

## Tools

- `cerebras_chat_completions`, `cerebras_completions`
- `cerebras_list_models`, `cerebras_retrieve_model`
- `cerebras_list_public_models`, `cerebras_retrieve_public_model`
- `cerebras_create_batch`, `cerebras_list_batches`,
  `cerebras_retrieve_batch`, `cerebras_cancel_batch`
- `cerebras_upload_file`, `cerebras_list_files`, `cerebras_retrieve_file`,
  `cerebras_retrieve_file_content`, `cerebras_delete_file`
- `cerebras_retrieve_metrics`
- `cerebras_list_model_architectures`, `cerebras_list_model_versions`,
  `cerebras_upload_model_version`, `cerebras_retrieve_model_version_status`,
  `cerebras_delete_model_version`, `cerebras_update_model_version_aliases`
- `cerebras_list_endpoints`, `cerebras_retrieve_endpoint_status`,
  `cerebras_deploy_model_to_endpoint`

## Examples

Chat completion:

```lua
local response = cerebras_chat_completions({
  body = {
    model = "gpt-oss-120b",
    messages = {
      { role = "user", content = "Write a short release note." }
    }
  }
})
```

List public models in OpenRouter format:

```lua
local models = cerebras_list_public_models({
  query = { format = "openrouter" }
})
```

Upload a batch file:

```lua
local uploaded = cerebras_upload_file({
  file_path = "/tmp/cerebras-batch.jsonl",
  body = { purpose = "batch" }
})
```

Retrieve endpoint metrics:

```lua
local metrics = cerebras_retrieve_metrics({
  organization_id = "org_abc123"
})
```

## Coverage notes

This package covers the endpoint inventory published in the Cerebras docs index
at implementation time: inference, completions, models, public models, batch,
files, metrics, and the customer management OpenAPI spec. Non-endpoint guide
pages such as authentication, versions, capabilities, and cookbooks are covered
by docs, not executable tools.
Metadata-derived Lua example
local result = app.integrations.cerebras.cancel_batch({})
print(result)

Functions

cancel_batch Write

Cerebras Cancel Batch

Lua path
app.integrations.cerebras.cancel_batch
Full name
cerebras.cerebras_cancel_batch
ParameterTypeRequiredDescription
No parameters.
chat_completions Read

Cerebras Chat Completions

Lua path
app.integrations.cerebras.chat_completions
Full name
cerebras.cerebras_chat_completions
ParameterTypeRequiredDescription
No parameters.
completions Read

Cerebras Completions

Lua path
app.integrations.cerebras.completions
Full name
cerebras.cerebras_completions
ParameterTypeRequiredDescription
No parameters.
create_batch Write

Cerebras Create Batch

Lua path
app.integrations.cerebras.create_batch
Full name
cerebras.cerebras_create_batch
ParameterTypeRequiredDescription
No parameters.
delete_file Write

Cerebras Delete File

Lua path
app.integrations.cerebras.delete_file
Full name
cerebras.cerebras_delete_file
ParameterTypeRequiredDescription
No parameters.
delete_model_version Write

Cerebras Delete Model Version

Lua path
app.integrations.cerebras.delete_model_version
Full name
cerebras.cerebras_delete_model_version
ParameterTypeRequiredDescription
No parameters.
deploy_model_endpoint Read

Cerebras Deploy Model To Endpoint

Lua path
app.integrations.cerebras.deploy_model_endpoint
Full name
cerebras.cerebras_deploy_model_to_endpoint
ParameterTypeRequiredDescription
No parameters.
list_batches Read

Cerebras List Batches

Lua path
app.integrations.cerebras.list_batches
Full name
cerebras.cerebras_list_batches
ParameterTypeRequiredDescription
No parameters.
list_endpoints Read

Cerebras List Endpoints

Lua path
app.integrations.cerebras.list_endpoints
Full name
cerebras.cerebras_list_endpoints
ParameterTypeRequiredDescription
No parameters.
list_files Read

Cerebras List Files

Lua path
app.integrations.cerebras.list_files
Full name
cerebras.cerebras_list_files
ParameterTypeRequiredDescription
No parameters.
list_model_architectures Read

Cerebras List Model Architectures

Lua path
app.integrations.cerebras.list_model_architectures
Full name
cerebras.cerebras_list_model_architectures
ParameterTypeRequiredDescription
No parameters.
list_model_versions Read

Cerebras List Model Versions

Lua path
app.integrations.cerebras.list_model_versions
Full name
cerebras.cerebras_list_model_versions
ParameterTypeRequiredDescription
No parameters.
list_models Read

Cerebras List Models

Lua path
app.integrations.cerebras.list_models
Full name
cerebras.cerebras_list_models
ParameterTypeRequiredDescription
No parameters.
list_public_models Read

Cerebras List Public Models

Lua path
app.integrations.cerebras.list_public_models
Full name
cerebras.cerebras_list_public_models
ParameterTypeRequiredDescription
No parameters.
retrieve_batch Read

Cerebras Retrieve Batch

Lua path
app.integrations.cerebras.retrieve_batch
Full name
cerebras.cerebras_retrieve_batch
ParameterTypeRequiredDescription
No parameters.
retrieve_endpoint_status Read

Cerebras Retrieve Endpoint Status

Lua path
app.integrations.cerebras.retrieve_endpoint_status
Full name
cerebras.cerebras_retrieve_endpoint_status
ParameterTypeRequiredDescription
No parameters.
retrieve_file Read

Cerebras Retrieve File

Lua path
app.integrations.cerebras.retrieve_file
Full name
cerebras.cerebras_retrieve_file
ParameterTypeRequiredDescription
No parameters.
retrieve_file_content Read

Cerebras Retrieve File Content

Lua path
app.integrations.cerebras.retrieve_file_content
Full name
cerebras.cerebras_retrieve_file_content
ParameterTypeRequiredDescription
No parameters.
retrieve_metrics Read

Cerebras Retrieve Metrics

Lua path
app.integrations.cerebras.retrieve_metrics
Full name
cerebras.cerebras_retrieve_metrics
ParameterTypeRequiredDescription
No parameters.
retrieve_model Read

Cerebras Retrieve Model

Lua path
app.integrations.cerebras.retrieve_model
Full name
cerebras.cerebras_retrieve_model
ParameterTypeRequiredDescription
No parameters.
retrieve_model_version_status Read

Cerebras Retrieve Model Version Status

Lua path
app.integrations.cerebras.retrieve_model_version_status
Full name
cerebras.cerebras_retrieve_model_version_status
ParameterTypeRequiredDescription
No parameters.
retrieve_public_model Read

Cerebras Retrieve Public Model

Lua path
app.integrations.cerebras.retrieve_public_model
Full name
cerebras.cerebras_retrieve_public_model
ParameterTypeRequiredDescription
No parameters.
update_model_version_aliases Write

Cerebras Update Model Version Aliases

Lua path
app.integrations.cerebras.update_model_version_aliases
Full name
cerebras.cerebras_update_model_version_aliases
ParameterTypeRequiredDescription
No parameters.
upload_file Read

Cerebras Upload File

Lua path
app.integrations.cerebras.upload_file
Full name
cerebras.cerebras_upload_file
ParameterTypeRequiredDescription
No parameters.
upload_model_version Read

Cerebras Upload Model Version

Lua path
app.integrations.cerebras.upload_model_version
Full name
cerebras.cerebras_upload_model_version
ParameterTypeRequiredDescription
No parameters.