ai
OpenAI MCP, CLI, and Lua Integration for AI Agents
OpenAI integration docs for AI agents: MCP gateway setup, OpenAI CLI commands, Lua API reference, credentials, and function schemas.
15 functions 5 read 10 write API key auth
OpenAI for agents
Credentials can be configured manually in web or CLI hosts.
Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.
Machine-Readable Metadata
- integration_slug
openai- route_slug
openai- package
openai- auth_strategy
api_keyAPI key- cli_setup_supported
true- cli_runtime_supported
true- mcp_gateway_supported
true- lua_supported
true- supports_multi_account
true
Quick Links
Lua APIAgent-facing namespace and function reference. OpenAI CLIHeadless setup and direct function calls. OpenAI MCPMCP gateway setup for external clients. Submit feedbackReport missing tools, auth problems, wrong docs, or runtime issues. ContributeAdd tools or improve metadata in the integrations repo.
OpenAI MCP Client Matrix
Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for OpenAI.
Claude Code OpenAI MCP setup for Claude Code. Cursor OpenAI MCP setup for Cursor. Codex OpenAI MCP setup for Codex. OpenAI Agents OpenAI MCP setup for OpenAI Agents SDK. Claude Agent SDK OpenAI MCP setup for Claude Agent SDK. Vercel AI SDK OpenAI MCP setup for Vercel AI SDK. LangChain OpenAI MCP setup for LangChain. LangGraph OpenAI MCP setup for LangGraph. CrewAI OpenAI MCP setup for CrewAI. MCP clients OpenAI MCP setup for Generic MCP Clients.
OpenAI CLI Matrix
Use these pages for direct OpenAI CLI workflows in scripts, CI, cron, and agent wrappers.
CI OpenAI CLI for CI. Cron Jobs OpenAI CLI for cron jobs. Shell Scripts OpenAI CLI for shell scripts. Headless Automation OpenAI CLI for headless automation. Coding Agents OpenAI CLI for coding agents.
Function Catalog
| Function | Type | Parameters | Description |
|---|---|---|---|
openai.openai_chat_completion | Write write | 8 | Generate a chat completion using OpenAI GPT models. Send a conversation as an array of messages with role and content. |
openai.openai_create_embedding | Write write | 2 | Generate an embedding vector for text input using OpenAI embedding models. |
openai.openai_create_image | Write write | 7 | Generate an image from a text prompt using DALL·E. |
openai.openai_transcribe_audio | Write write | 5 | Transcribe audio into text using OpenAI Whisper. Supports MP3, MP4, WAV, M4A, and WEBM audio files. |
openai.openai_text_to_speech | Write write | 5 | Generate speech audio from text using OpenAI TTS. Returns base64-encoded audio content. |
openai.openai_create_assistant | Write write | 5 | Create an OpenAI assistant with a model, name, instructions, and optional tools. |
openai.openai_list_assistants | Read read | 1 | List all OpenAI assistants available to the authenticated user. |
openai.openai_create_thread | Write write | 1 | Create a conversation thread for the OpenAI Assistants API. Optionally include initial messages. |
openai.openai_add_message_to_thread | Write write | 3 | Add a message to an existing conversation thread. |
openai.openai_list_thread_messages | Read read | 2 | List messages in an OpenAI conversation thread. |
openai.openai_create_run | Write write | 3 | Start an assistant run on a thread. Returns the run with its initial status. |
openai.openai_get_run | Read read | 2 | Get the status and details of an assistant run on a thread. |
openai.openai_upload_file | Write write | 3 | Upload a file to OpenAI for use with Assistants, Fine-tuning, or Batch API. |
openai.openai_list_files | Read read | 2 | List files uploaded to OpenAI, optionally filtered by purpose. |
openai.openai_list_models | Read read | 0 | List all models available from OpenAI, including GPT, DALL·E, Whisper, and embedding models. |