KosmoKrator

documents

API Template IO CLI for AI Agents

Use the API Template IO CLI from KosmoKrator to call API Template IO tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

5 functions 3 read 2 write API key auth

API Template IO CLI Setup

API Template IO can be configured headlessly with `kosmokrator integrations:configure apitemplateio`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure apitemplateio --set api_key="$APITEMPLATEIO_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor apitemplateio --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key APITEMPLATEIO_API_KEY Secret secret yes API Key
url APITEMPLATEIO_URL URL url no API Base URL

Call API Template IO Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call apitemplateio.apitemplateio_create_pdf '{
  "template_id": "example_template_id",
  "data": "example_data",
  "output_html": true,
  "expire": 1,
  "meta": "example_meta"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:apitemplateio apitemplateio_create_pdf '{
  "template_id": "example_template_id",
  "data": "example_data",
  "output_html": true,
  "expire": 1,
  "meta": "example_meta"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs apitemplateio --json
kosmo integrations:docs apitemplateio.apitemplateio_create_pdf --json
kosmo integrations:schema apitemplateio.apitemplateio_create_pdf --json
kosmo integrations:search "API Template IO" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to API Template IO.

apitemplateio.apitemplateio_create_pdf

Write write

Generate a PDF document from an API Template IO template. Provide a template ID and the data to merge into the template.

Parameters
template_id, data, output_html, expire, meta

Generic CLI call

kosmo integrations:call apitemplateio.apitemplateio_create_pdf '{"template_id":"example_template_id","data":"example_data","output_html":true,"expire":1,"meta":"example_meta"}' --json

Provider shortcut

kosmo integrations:apitemplateio apitemplateio_create_pdf '{"template_id":"example_template_id","data":"example_data","output_html":true,"expire":1,"meta":"example_meta"}' --json

apitemplateio.apitemplateio_create_image

Write write

Generate an image (PNG or JPEG) from an API Template IO template. Provide a template ID, data, and the desired output format.

Parameters
template_id, data, output_format, output_html, expire, meta

Generic CLI call

kosmo integrations:call apitemplateio.apitemplateio_create_image '{"template_id":"example_template_id","data":"example_data","output_format":"example_output_format","output_html":true,"expire":1,"meta":"example_meta"}' --json

Provider shortcut

kosmo integrations:apitemplateio apitemplateio_create_image '{"template_id":"example_template_id","data":"example_data","output_format":"example_output_format","output_html":true,"expire":1,"meta":"example_meta"}' --json

apitemplateio.apitemplateio_list_templates

Read read

List available templates in API Template IO. Returns a paginated list of template IDs, names, and metadata.

Parameters
limit, offset, filter

Generic CLI call

kosmo integrations:call apitemplateio.apitemplateio_list_templates '{"limit":1,"offset":1,"filter":"example_filter"}' --json

Provider shortcut

kosmo integrations:apitemplateio apitemplateio_list_templates '{"limit":1,"offset":1,"filter":"example_filter"}' --json

apitemplateio.apitemplateio_get_template

Read read

Get details for a specific API Template IO template by ID. Returns the template definition, schema, and configuration.

Parameters
template_id

Generic CLI call

kosmo integrations:call apitemplateio.apitemplateio_get_template '{"template_id":"example_template_id"}' --json

Provider shortcut

kosmo integrations:apitemplateio apitemplateio_get_template '{"template_id":"example_template_id"}' --json

apitemplateio.apitemplateio_get_current_user

Read read

Get the current authenticated user's account information from API Template IO, including usage and subscription details.

Parameters
none

Generic CLI call

kosmo integrations:call apitemplateio.apitemplateio_get_current_user '{}' --json

Provider shortcut

kosmo integrations:apitemplateio apitemplateio_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

apitemplateio.apitemplateio_create_pdf

Generate a PDF document from an API Template IO template. Provide a template ID and the data to merge into the template.

Operation
Write write
Schema command
kosmo integrations:schema apitemplateio.apitemplateio_create_pdf --json
ParameterTypeRequiredDescription
template_id string yes The template ID to use for PDF generation (e.g., "tpl_abc123").
data object yes Key-value pairs to merge into the template placeholders.
output_html boolean no If true, returns the rendered HTML in addition to the PDF URL.
expire integer no Number of minutes after which the generated file URL expires (default: no expiry).
meta string no Optional metadata string to attach to the generation request.

apitemplateio.apitemplateio_create_image

Generate an image (PNG or JPEG) from an API Template IO template. Provide a template ID, data, and the desired output format.

Operation
Write write
Schema command
kosmo integrations:schema apitemplateio.apitemplateio_create_image --json
ParameterTypeRequiredDescription
template_id string yes The template ID to use for image generation (e.g., "tpl_abc123").
data object yes Key-value pairs to merge into the template placeholders.
output_format string no The image format to generate: "png" or "jpeg". Defaults to "png".
output_html boolean no If true, returns the rendered HTML in addition to the image URL.
expire integer no Number of minutes after which the generated file URL expires (default: no expiry).
meta string no Optional metadata string to attach to the generation request.

apitemplateio.apitemplateio_list_templates

List available templates in API Template IO. Returns a paginated list of template IDs, names, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema apitemplateio.apitemplateio_list_templates --json
ParameterTypeRequiredDescription
limit integer no Number of templates to return per page (default: 50, max: 100).
offset integer no Offset for pagination — number of templates to skip (default: 0).
filter string no Optional filter expression to narrow down templates.

apitemplateio.apitemplateio_get_template

Get details for a specific API Template IO template by ID. Returns the template definition, schema, and configuration.

Operation
Read read
Schema command
kosmo integrations:schema apitemplateio.apitemplateio_get_template --json
ParameterTypeRequiredDescription
template_id string yes The template ID to retrieve (e.g., "tpl_abc123").

apitemplateio.apitemplateio_get_current_user

Get the current authenticated user's account information from API Template IO, including usage and subscription details.

Operation
Read read
Schema command
kosmo integrations:schema apitemplateio.apitemplateio_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.