KosmoKrator

ai

Groq CLI for AI Agents

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

7 functions 5 read 2 write API key auth

Groq CLI Setup

Groq can be configured headlessly with `kosmokrator integrations:configure groq`.

# 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 groq --set api_key="$GROQ_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor groq --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 GROQ_API_KEY Secret secret yes API Key
url GROQ_URL URL url no API Base URL

Call Groq Headlessly

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

kosmo integrations:call groq.groq_list_models '{}' --json

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

kosmo integrations:groq groq_list_models '{}' --json

Agent Discovery Commands

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

kosmo integrations:docs groq --json
kosmo integrations:docs groq.groq_list_models --json
kosmo integrations:schema groq.groq_list_models --json
kosmo integrations:search "Groq" --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 Groq.

groq.groq_list_models

Read read

List available Groq AI models. Returns model IDs, ownership, and other metadata for models accessible via the Groq API.

Parameters
none

Generic CLI call

kosmo integrations:call groq.groq_list_models '{}' --json

Provider shortcut

kosmo integrations:groq groq_list_models '{}' --json

groq.groq_create_completion

Write write

Create a chat completion using a Groq model. Send a list of messages and receive an AI-generated response with ultra-low latency. Supports configurable parameters like temperature, max_tokens, and top_p.

Parameters
model, messages, temperature, max_tokens, top_p, stream

Generic CLI call

kosmo integrations:call groq.groq_create_completion '{"model":"example_model","messages":"example_messages","temperature":1,"max_tokens":1,"top_p":1,"stream":true}' --json

Provider shortcut

kosmo integrations:groq groq_create_completion '{"model":"example_model","messages":"example_messages","temperature":1,"max_tokens":1,"top_p":1,"stream":true}' --json

groq.groq_list_messages

Read read

List messages in a Groq Cloud conversation. Returns message content, role, and metadata for each message in the conversation.

Parameters
conversation_id, limit, after

Generic CLI call

kosmo integrations:call groq.groq_list_messages '{"conversation_id":"example_conversation_id","limit":1,"after":"example_after"}' --json

Provider shortcut

kosmo integrations:groq groq_list_messages '{"conversation_id":"example_conversation_id","limit":1,"after":"example_after"}' --json

groq.groq_create_message

Write write

Create a message in a Groq Cloud conversation. Send a message with a specified role and content to a conversation.

Parameters
conversation_id, role, content

Generic CLI call

kosmo integrations:call groq.groq_create_message '{"conversation_id":"example_conversation_id","role":"example_role","content":"example_content"}' --json

Provider shortcut

kosmo integrations:groq groq_create_message '{"conversation_id":"example_conversation_id","role":"example_role","content":"example_content"}' --json

groq.groq_list_files

Read read

List files uploaded to the Groq Files API. Returns file IDs, filenames, purposes, sizes, and upload timestamps.

Parameters
purpose, limit, after

Generic CLI call

kosmo integrations:call groq.groq_list_files '{"purpose":"example_purpose","limit":1,"after":"example_after"}' --json

Provider shortcut

kosmo integrations:groq groq_list_files '{"purpose":"example_purpose","limit":1,"after":"example_after"}' --json

groq.groq_get_file

Read read

Get metadata for an uploaded file in Groq, including its ID, filename, purpose, size in bytes, and processing status.

Parameters
file_id

Generic CLI call

kosmo integrations:call groq.groq_get_file '{"file_id":"example_file_id"}' --json

Provider shortcut

kosmo integrations:groq groq_get_file '{"file_id":"example_file_id"}' --json

groq.groq_get_current_user

Read read

Get information about the currently authenticated Groq user, including user ID, email, and organization details.

Parameters
none

Generic CLI call

kosmo integrations:call groq.groq_get_current_user '{}' --json

Provider shortcut

kosmo integrations:groq groq_get_current_user '{}' --json

Function Schemas

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

groq.groq_list_models

List available Groq AI models. Returns model IDs, ownership, and other metadata for models accessible via the Groq API.

Operation
Read read
Schema command
kosmo integrations:schema groq.groq_list_models --json
ParameterTypeRequiredDescription
No parameters.

groq.groq_create_completion

Create a chat completion using a Groq model. Send a list of messages and receive an AI-generated response with ultra-low latency. Supports configurable parameters like temperature, max_tokens, and top_p.

Operation
Write write
Schema command
kosmo integrations:schema groq.groq_create_completion --json
ParameterTypeRequiredDescription
model string yes The model ID to use (e.g., "llama-3.3-70b-versatile", "mixtral-8x7b-32768", "gemma2-9b-it").
messages array yes Array of message objects. Each message should have a "role" ("system", "user", or "assistant") and "content" string.
temperature number no Controls randomness in generation (0.0–2.0). Lower values are more deterministic, higher values more creative.
max_tokens integer no Maximum number of tokens to generate in the response.
top_p number no Nucleus sampling parameter (0.0–1.0). Limits cumulative probability of tokens considered.
stream boolean no Whether to stream the response. Defaults to false.

groq.groq_list_messages

List messages in a Groq Cloud conversation. Returns message content, role, and metadata for each message in the conversation.

Operation
Read read
Schema command
kosmo integrations:schema groq.groq_list_messages --json
ParameterTypeRequiredDescription
conversation_id string yes The conversation ID to list messages for.
limit integer no Maximum number of messages to return per page (default: 20).
after string no Cursor for pagination — message ID to start after.

groq.groq_create_message

Create a message in a Groq Cloud conversation. Send a message with a specified role and content to a conversation.

Operation
Write write
Schema command
kosmo integrations:schema groq.groq_create_message --json
ParameterTypeRequiredDescription
conversation_id string yes The conversation ID to add the message to.
role string yes The role of the message author (e.g., "user", "assistant").
content string yes The text content of the message.

groq.groq_list_files

List files uploaded to the Groq Files API. Returns file IDs, filenames, purposes, sizes, and upload timestamps.

Operation
Read read
Schema command
kosmo integrations:schema groq.groq_list_files --json
ParameterTypeRequiredDescription
purpose string no Filter files by purpose (e.g., "batch").
limit integer no Maximum number of files to return per page (default: 20).
after string no Cursor for pagination — file ID to start after.

groq.groq_get_file

Get metadata for an uploaded file in Groq, including its ID, filename, purpose, size in bytes, and processing status.

Operation
Read read
Schema command
kosmo integrations:schema groq.groq_get_file --json
ParameterTypeRequiredDescription
file_id string yes The file identifier (e.g., "file-abc123").

groq.groq_get_current_user

Get information about the currently authenticated Groq user, including user ID, email, and organization details.

Operation
Read read
Schema command
kosmo integrations:schema groq.groq_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.