Actions2
Chat Completions
AI-generatedSummary
Send chat messages using the GitHub Copilot OpenAI-compatible API to receive AI-generated completions as chat responses.
Inputs
- Model — Select the GitHub Copilot model to use; options are loaded dynamically based on your subscription. You can also manually enter a custom model name for new or beta models.
- Messages Input Mode (required) — Choose how to provide the conversation messages for the chat completion: manually via UI fields or programmatically as a JSON array.
- Messages (JSON) (required) — Provide an array of message objects in OpenAI format for programmatic input mode. Each message includes role and content.
- Messages (required) — Provide an array of messages manually, specifying each message's role (system, user, assistant), content, type (text, file URL/Base64, or binary file), and optional caption for images.
- Advanced Options — Configure advanced parameters including response format (text or JSON object), temperature, max tokens, top_p, frequency and presence penalties, stop sequences, streaming, seed for sampling, user ID, optional tools for function calling, retry settings, request timeout, debug mode, and vision fallback options for models not supporting image inputs.
Output shape
a JSON object representing the chat completion response following OpenAI-compatible format, including message choices, usage metrics, and optional metadata.
The response includes an array of choices with the assistant's generated messages. The response format can be plain text or a JSON object depending on settings. Errors are thrown for request issues. Supports streaming responses and function calling via tools if configured.
Examples
Example 1: Manually provide user and system messages as chat input to receive an AI-generated chat response with a chosen model.
Select model (e.g., 'gpt-4.1'), choose 'Manual (UI)' for Messages Input Mode, enter messages with roles and content. Optionally set advanced options for temperature, max tokens, or streaming.