OpenAI CLI Setup OpenAI can be configured headlessly with `kosmokrator integrations:configure openai`.
# 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 openai --set api_key=" $OPENAI_API_KEY " --enable --read allow --write ask --json
kosmokrator integrations:doctor openai --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.
Call OpenAI Headlessly Use the generic call form when another coding CLI or script needs a stable universal interface.
kosmo integrations:call openai.openai_chat_completion '{
"model": "example_model",
"messages": "example_messages",
"temperature": 1,
"max_tokens": 1,
"top_p": 1,
"frequency_penalty": 1,
"presence_penalty": 1,
"response_format": "example_response_format"
}' --json Use the provider shortcut form for shorter human-facing commands.
kosmo integrations:openai openai_chat_completion '{
"model": "example_model",
"messages": "example_messages",
"temperature": 1,
"max_tokens": 1,
"top_p": 1,
"frequency_penalty": 1,
"presence_penalty": 1,
"response_format": "example_response_format"
}' --json Agent Discovery Commands
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs openai --json
kosmo integrations:docs openai.openai_chat_completion --json
kosmo integrations:schema openai.openai_chat_completion --json
kosmo integrations:search "OpenAI" --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 OpenAI.
openai.openai_chat_completion Write write Generate a chat completion using OpenAI GPT models. Send a conversation as an array of messages with role and content.
model, messages, temperature, max_tokens, top_p, frequency_penalty, presence_penalty, response_format kosmo integrations:call openai.openai_chat_completion '{"model":"example_model","messages":"example_messages","temperature":1,"max_tokens":1,"top_p":1,"frequency_penalty":1,"presence_penalty":1,"response_format":"example_response_format"}' --json copy kosmo integrations:openai openai_chat_completion '{"model":"example_model","messages":"example_messages","temperature":1,"max_tokens":1,"top_p":1,"frequency_penalty":1,"presence_penalty":1,"response_format":"example_response_format"}' --json copy
openai.openai_create_embedding Write write Generate an embedding vector for text input using OpenAI embedding models.
model, input kosmo integrations:call openai.openai_create_embedding '{"model":"example_model","input":"example_input"}' --json copy kosmo integrations:openai openai_create_embedding '{"model":"example_model","input":"example_input"}' --json copy
openai.openai_create_image Write write Generate an image from a text prompt using DALL·E.
model, prompt, n, size, quality, style, response_format kosmo integrations:call openai.openai_create_image '{"model":"example_model","prompt":"example_prompt","n":1,"size":"example_size","quality":"example_quality","style":"example_style","response_format":"example_response_format"}' --json copy kosmo integrations:openai openai_create_image '{"model":"example_model","prompt":"example_prompt","n":1,"size":"example_size","quality":"example_quality","style":"example_style","response_format":"example_response_format"}' --json copy
openai.openai_transcribe_audio Write write Transcribe audio into text using OpenAI Whisper. Supports MP3, MP4, WAV, M4A, and WEBM audio files.
file_content, filename, model, language, response_format kosmo integrations:call openai.openai_transcribe_audio '{"file_content":"example_file_content","filename":"example_filename","model":"example_model","language":"example_language","response_format":"example_response_format"}' --json copy kosmo integrations:openai openai_transcribe_audio '{"file_content":"example_file_content","filename":"example_filename","model":"example_model","language":"example_language","response_format":"example_response_format"}' --json copy
openai.openai_text_to_speech Write write Generate speech audio from text using OpenAI TTS. Returns base64-encoded audio content.
model, input, voice, speed, response_format kosmo integrations:call openai.openai_text_to_speech '{"model":"example_model","input":"example_input","voice":"example_voice","speed":1,"response_format":"example_response_format"}' --json copy kosmo integrations:openai openai_text_to_speech '{"model":"example_model","input":"example_input","voice":"example_voice","speed":1,"response_format":"example_response_format"}' --json copy
openai.openai_create_assistant Write write Create an OpenAI assistant with a model, name, instructions, and optional tools.
model, name, description, instructions, tools kosmo integrations:call openai.openai_create_assistant '{"model":"example_model","name":"example_name","description":"example_description","instructions":"example_instructions","tools":"example_tools"}' --json copy kosmo integrations:openai openai_create_assistant '{"model":"example_model","name":"example_name","description":"example_description","instructions":"example_instructions","tools":"example_tools"}' --json copy
openai.openai_list_assistants Read read List all OpenAI assistants available to the authenticated user.
limit kosmo integrations:call openai.openai_list_assistants '{"limit":1}' --json copy kosmo integrations:openai openai_list_assistants '{"limit":1}' --json copy
openai.openai_create_thread Write write Create a conversation thread for the OpenAI Assistants API. Optionally include initial messages.
messages kosmo integrations:call openai.openai_create_thread '{"messages":"example_messages"}' --json copy kosmo integrations:openai openai_create_thread '{"messages":"example_messages"}' --json copy
openai.openai_add_message_to_thread Write write Add a message to an existing conversation thread.
thread_id, role, content kosmo integrations:call openai.openai_add_message_to_thread '{"thread_id":"example_thread_id","role":"example_role","content":"example_content"}' --json copy kosmo integrations:openai openai_add_message_to_thread '{"thread_id":"example_thread_id","role":"example_role","content":"example_content"}' --json copy
openai.openai_list_thread_messages Read read List messages in an OpenAI conversation thread.
thread_id, limit kosmo integrations:call openai.openai_list_thread_messages '{"thread_id":"example_thread_id","limit":1}' --json copy kosmo integrations:openai openai_list_thread_messages '{"thread_id":"example_thread_id","limit":1}' --json copy
openai.openai_create_run Write write Start an assistant run on a thread. Returns the run with its initial status.
thread_id, assistant_id, instructions kosmo integrations:call openai.openai_create_run '{"thread_id":"example_thread_id","assistant_id":"example_assistant_id","instructions":"example_instructions"}' --json copy kosmo integrations:openai openai_create_run '{"thread_id":"example_thread_id","assistant_id":"example_assistant_id","instructions":"example_instructions"}' --json copy
openai.openai_get_run Read read Get the status and details of an assistant run on a thread.
thread_id, run_id kosmo integrations:call openai.openai_get_run '{"thread_id":"example_thread_id","run_id":"example_run_id"}' --json copy kosmo integrations:openai openai_get_run '{"thread_id":"example_thread_id","run_id":"example_run_id"}' --json copy
openai.openai_upload_file Write write Upload a file to OpenAI for use with Assistants, Fine-tuning, or Batch API.
file_content, filename, purpose kosmo integrations:call openai.openai_upload_file '{"file_content":"example_file_content","filename":"example_filename","purpose":"example_purpose"}' --json copy kosmo integrations:openai openai_upload_file '{"file_content":"example_file_content","filename":"example_filename","purpose":"example_purpose"}' --json copy
openai.openai_list_files Read read List files uploaded to OpenAI, optionally filtered by purpose.
purpose, limit kosmo integrations:call openai.openai_list_files '{"purpose":"example_purpose","limit":1}' --json copy kosmo integrations:openai openai_list_files '{"purpose":"example_purpose","limit":1}' --json copy
openai.openai_list_models Read read List all models available from OpenAI, including GPT, DALL·E, Whisper, and embedding models.
none kosmo integrations:call openai.openai_list_models '{}' --json copy kosmo integrations:openai openai_list_models '{}' --json copy Function Schemas Use these parameter tables when building CLI payloads without calling integrations:schema first.
Operation Write write
Schema command kosmo integrations:schema openai.openai_chat_completion --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_create_embedding --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_create_image --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_transcribe_audio --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_text_to_speech --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_create_assistant --json
Operation Read read
Schema command kosmo integrations:schema openai.openai_list_assistants --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_create_thread --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_add_message_to_thread --json
Operation Read read
Schema command kosmo integrations:schema openai.openai_list_thread_messages --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_create_run --json
Operation Read read
Schema command kosmo integrations:schema openai.openai_get_run --json
Operation Write write
Schema command kosmo integrations:schema openai.openai_upload_file --json
Operation Read read
Schema command kosmo integrations:schema openai.openai_list_files --json
Operation Read read
Schema command kosmo integrations:schema openai.openai_list_models --json 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.