GitHub Copilot Chat API icon

GitHub Copilot Chat API

Use official GitHub Copilot Chat API with your subscription - access GPT-5, Claude, Gemini and more

Overview

This node integrates with the official GitHub Copilot Chat API, enabling users to send chat messages to advanced AI models such as GPT-5, Claude Opus, Google Gemini, and others. It supports both text-only and multimodal interactions by optionally including images in the conversation.

Common scenarios where this node is beneficial include:

  • Generating AI-powered chat responses for customer support or virtual assistants.
  • Leveraging advanced AI models for coding assistance or content generation.
  • Enhancing chatbot interactions with image inputs for richer context.
  • Experimenting with different AI models to compare outputs or optimize cost/performance.

Practical example:

  • A user sends a prompt asking for code suggestions while attaching a screenshot of an error message. The node processes the image along with the text and returns a contextual response from the selected AI model.

Properties

Name Meaning
Model Select which AI model to use. Options include: GPT-5 (latest, supports images), GPT-5 Mini (faster, cost-effective, supports images), Claude Opus 4.1 (advanced reasoning, text only), Gemini 2.5 Pro (multimodal), Grok Code Fast 1 (coding optimized, text only), GPT-4.1 Copilot (coding specialized, supports images).
Message The main message or prompt to send to the AI model.
System Message Optional system-level instruction to set the behavior or persona of the AI assistant.
Include Image Boolean flag to indicate whether to include an image file with the message. Supported formats are PNG, JPEG, GIF, WebP.
Image Source If including an image, select the source type: Manual Input (base64 string or file path), URL (download image from web), or Binary Data (use binary data from previous node).
Image File When using Manual Input, provide the image as a base64 string or local file path.
Image URL When using URL source, specify the direct link to the image file.
Image Binary Property When using Binary Data source, specify the name of the binary property containing the image file.
Advanced Options Collection of optional parameters to customize the AI response:
- Temperature Controls randomness of the output; higher values produce more random results (range 0 to 2).
- Max Tokens Maximum number of tokens to generate in the AI response (up to 128000).
- Top P Alternative to temperature controlling diversity via nucleus sampling (range 0 to 1).

Output

The node outputs JSON data structured as follows:

{
  "message": "AI-generated response text",
  "model": "selected model identifier",
  "operation": "chat",
  "usage": { /* token usage statistics if available */ },
  "finish_reason": "reason why the generation stopped (e.g., 'stop', 'length', or 'unknown')"
}
  • message: The textual reply generated by the AI model.
  • model: The AI model used for generating the response.
  • operation: Always "chat" in this implementation.
  • usage: Optional object detailing token consumption.
  • finish_reason: Indicates why the AI stopped generating text.

If an image was included in the input, it is processed and sent to the API but the output remains textual. The node does not output binary image data directly.

In case of errors (and if "Continue On Fail" is enabled), the output JSON will contain an error field describing the issue.

Dependencies

  • Requires a valid subscription and credentials for the GitHub Copilot Chat API.
  • The node depends on internal utility modules for media processing and API requests.
  • Supports downloading images from URLs or reading binary data from previous nodes.
  • No additional environment variables are explicitly required beyond the API credential.

Troubleshooting

  • Model Capability Validation Failed: If you enable image inclusion but select a model that does not support images (e.g., Claude Opus 4.1), the node will throw a validation error. Choose a compatible model or disable image input.
  • Media Processing Errors: If the image cannot be processed (invalid format, corrupted data, inaccessible URL), the node inserts an error message into the chat content instead of the image. Check image source validity and format.
  • API Request Failures: Network issues, invalid credentials, or quota limits may cause request failures. Verify your API key and network connectivity.
  • Token Limits Exceeded: Setting max_tokens too high may cause errors. Adjust to reasonable values within allowed limits.
  • Unexpected Errors: Enable "Continue On Fail" to capture errors in output JSON for debugging without stopping workflow execution.

Links and References

Discussion