openai_chat_completion
Generate responses from OpenAI models like GPT-4o by providing a prompt or messages, with options for system instructions, token limits, and response format.
Instructions
Run a chat completion with an OpenAI model (GPT-4o, GPT-4, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | Yes | ||
| model | No | Model ID, e.g. gpt-4o, gpt-4o-mini (default: gpt-4o-mini) | |
| prompt | No | Convenience: single user message (alternative to messages array) | |
| system_prompt | No | System instruction (used with prompt param) | |
| messages | No | Array of {role, content} message objects (alternative to prompt) | |
| max_tokens | No | ||
| temperature | No | ||
| top_p | No | ||
| n | No | ||
| response_format | No | e.g. {type: 'json_object'} | |
| seed | No | ||
| org_id | No | OpenAI organization ID (optional) |