Use the Anthropic CLI from KosmoKrator to call Anthropic tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Anthropic can be configured headlessly with `kosmokrator integrations:configure anthropic`.
# 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 anthropic --set api_key="$ANTHROPIC_API_KEY" --enable --read allow --write ask --jsonkosmokrator integrations:doctor anthropic --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
ANTHROPIC_API_KEY
Secret secret
yes
API Key
url
ANTHROPIC_URL
URL url
no
API Base URL
Call Anthropic Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Anthropic.
anthropic.anthropic_list_messages
Read read
List messages in the Anthropic conversation history. Returns paginated message resources with optional filtering by model, date, and ID.
Send a prompt to Claude and receive an AI-generated response. Supports multi-turn conversations, system prompts, temperature control, and configurable output length.
Filter messages by model ID (e.g., "claude-sonnet-4-20250514").
limit
integer
no
Maximum number of messages to return per page (default: 20, max: 1000).
before_id
string
no
Message ID used for cursor-based pagination — return messages before this ID.
after_id
string
no
Message ID used for cursor-based pagination — return messages after this ID.
anthropic.anthropic_create_message
Send a prompt to Claude and receive an AI-generated response. Supports multi-turn conversations, system prompts, temperature control, and configurable output length.
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.