Skip to main content

Overview

The OpenAI integration provides access to ChatGPT models through the Chat completion endpoint. Supports all GPT models including GPT-4, GPT-4 Turbo, GPT-3.5 Turbo, and the latest o1 reasoning models.

Setup

1

Get API Key

Sign up at OpenAI Platform and generate an API key from the API keys section
2

Add Credential

In Flowise, navigate to Credentials and create a new OpenAI API credential with your key
3

Add to Canvas

Drag the ChatOpenAI node from the Chat Models category to your canvas

Configuration

Basic Parameters

credential
credential
required
Your OpenAI API credential containing the API key
modelName
string
default:"gpt-4o-mini"
The model to use. Available models are loaded dynamically from your account.Popular options:
  • gpt-4o - Latest GPT-4 Omni model
  • gpt-4o-mini - Faster, cost-effective GPT-4 variant
  • gpt-4-turbo - GPT-4 Turbo with vision
  • gpt-3.5-turbo - Fast and economical
  • o1-preview - Advanced reasoning model
temperature
number
Controls randomness. Lower values (0.1) make output more deterministic, higher values (0.9) more creative
streaming
boolean
default:true
Enable streaming responses for real-time output

Advanced Parameters

maxTokens
number
Maximum number of tokens to generate in the response
topP
number
Nucleus sampling parameter. Alternative to temperature for controlling randomness
frequencyPenalty
number
Penalize new tokens based on their frequency in the text so far (-2.0 to 2.0)
presencePenalty
number
Penalize new tokens based on whether they appear in the text so far (-2.0 to 2.0)
stopSequence
string
List of sequences where the API will stop generating. Separate multiple with commas
timeout
number
Request timeout in milliseconds
strictToolCalling
boolean
Enable strict mode for function calling to ensure JSON schema compliance

Vision Support

allowImageUploads
boolean
default:false
Enable image input for vision-capable models like GPT-4 Turbo and GPT-4o
imageResolution
string
default:"low"
Control image resolution for vision models:
  • low - Faster, lower cost
  • high - Better detail recognition
  • auto - Let the model decide

Reasoning Models (o1, o3)

Reasoning models like o1-preview and o3-mini have special parameters and don’t support temperature or stop sequences.
reasoning
boolean
default:false
Enable reasoning mode for o1/o3 models
reasoningEffort
string
Constrain reasoning effort:
  • low - Faster responses
  • medium - Balanced
  • high - Most thorough reasoning
reasoningSummary
string
Get a summary of the model’s reasoning process:
  • auto - Default behavior
  • concise - Brief summary
  • detailed - Full reasoning trace

Proxy & Custom Configuration

basePath
string
Custom API base URL for OpenAI-compatible endpoints
proxyUrl
string
HTTPS proxy URL for routing requests
baseOptions
json
Custom headers and configuration as JSON

Usage Examples

Basic Chat Model

// Configuration in Flowise UI
Model Name: gpt-4o-mini
Temperature: 0.7
Max Tokens: 2000
Streaming: true

Function Calling Agent

// Use with Tool Agent for function calling
Model Name: gpt-4o
Strict Tool Calling: true  // Ensures strict JSON schema
Temperature: 0.1  // Lower for more reliable function calls

Vision-Enabled Chat

// Enable image analysis
Model Name: gpt-4o
Allow Image Uploads: true
Image Resolution: high

Reasoning Model

// o1-preview configuration
Model Name: o1-preview
Reasoning: true
Reasoning Effort: high
Reasoning Summary: detailed
// Note: Temperature and stop sequences are automatically disabled

Best Practices

Model Selection

  • Use gpt-4o-mini for most tasks (cost-effective)
  • Use gpt-4o for complex reasoning
  • Use o1-preview for advanced problem-solving

Cost Optimization

  • Enable caching to reduce repeated calls
  • Set appropriate maxTokens limits
  • Use gpt-3.5-turbo for simple tasks

Function Calling

  • Enable strictToolCalling for reliability
  • Lower temperature (0.1-0.3) for tool use
  • Provide clear function descriptions

Performance

  • Enable streaming for better UX
  • Set reasonable timeout values
  • Use appropriate reasoning effort

Common Issues

OpenAI enforces rate limits based on your usage tier:
  • Add retry logic with exponential backoff
  • Monitor your usage in the OpenAI dashboard
  • Consider upgrading your usage tier
If you exceed the model’s context window:
  • Reduce maxTokens parameter
  • Implement conversation summarization
  • Use a model with larger context (e.g., gpt-4-turbo-128k)
o1 and o3 models have different requirements:
  • Don’t set temperature (automatically disabled)
  • Don’t use stop sequences
  • Enable reasoning parameter

Build docs developers (and LLMs) love