Skip to main content
PentAGI integrates with OpenAI’s advanced language models, including the latest reasoning-capable o-series models designed for complex analytical tasks.

Environment Variables

OPEN_AI_KEY
string
required
Your OpenAI API key. Obtain it from OpenAI Platform.
OPEN_AI_SERVER_URL
string
default:"https://api.openai.com/v1"
OpenAI API endpoint URL. Use the default for standard OpenAI API access.
PROXY_URL
string
Optional HTTP proxy URL for enhanced security and network isolation (e.g., http://your-proxy:8080).

Configuration Example

Add the following to your .env file:
# Basic OpenAI setup
OPEN_AI_KEY=sk-proj-...
OPEN_AI_SERVER_URL=https://api.openai.com/v1

# Using with proxy for enhanced security
OPEN_AI_KEY=sk-proj-...
PROXY_URL=http://your-proxy:8080

Supported Models

OpenAI provider offers cutting-edge capabilities across multiple model families:

Reasoning Models (o-series)

Advanced models with step-by-step analytical thinking capabilities:
  • o4-mini - Cost-effective reasoning model for complex tasks
  • o3-mini - Balanced reasoning performance and cost
  • o3 - Flagship reasoning model for deep security analysis
  • o1 - Previous generation reasoning model

GPT-4.1 Series

Latest flagship models optimized for complex security research:
  • gpt-4.1 - Latest GPT-4 model with enhanced capabilities
  • gpt-4.1-mini - Cost-effective variant for high-volume tasks
  • gpt-5-mini - Next-generation mini model

Model Selection by Agent Type

PentAGI automatically selects appropriate models based on task complexity:
Agent TypeDefault ModelTemperatureMax TokensUse Case
Simple tasksgpt-4.1-mini0.53,000Quick queries and basic analysis
Simple JSONgpt-4.1-mini0.53,000Structured data extraction
Primary Agento3-mini / o4-mini-4,000Core penetration testing
Assistanto3-mini / o4-mini-6,000Multi-step security workflows
Generatoro3-mini / o3-8,192Report and exploit generation
Refinergpt-4.10.76,000Result refinement and analysis
Advisero3-mini / o4-mini-4,000Strategic recommendations
Reflectoro3-mini / o4-mini-3,000Analysis review and critique
Searchergpt-4.1-mini0.74,000Information gathering
Enrichergpt-4.1-mini0.74,000Data enrichment
Codergpt-4.10.26,000Exploit development
Installergpt-4.10.26,000Tool installation and setup
Pentestero3-mini / o4-mini-4,000Dedicated penetration testing
Reasoning models (o-series) use reasoning.effort parameter instead of temperature. The effort levels are: low, medium, and high.

Features

  • Advanced Reasoning: o-series models with step-by-step analytical thinking
  • Latest GPT-4.1 Series: Flagship models optimized for complex security research
  • Cost-Effective Options: From nano models for high-volume scanning to powerful reasoning models
  • Versatile Performance: Fast, intelligent models for multi-step security analysis
  • Proven Reliability: Industry-leading models with consistent performance

Pricing

Example pricing per million tokens (as configured in the provider):
ModelInput ($/M tokens)Output ($/M tokens)
gpt-4.1-mini$0.40$1.60
gpt-4.1$2.00$8.00
o3-mini / o4-mini$1.10$4.40
Pricing is subject to change. Check OpenAI Pricing for current rates.

Custom Provider Configuration

For advanced users, you can customize model selection per agent type using a YAML configuration file:
simple:
  model: "gpt-4.1-mini"
  temperature: 0.5
  top_p: 0.5
  n: 1
  max_tokens: 3000
  price:
    input: 0.4
    output: 1.6

primary_agent:
  model: "o3-mini"
  n: 1
  max_tokens: 4000
  reasoning:
    effort: low
  price:
    input: 1.1
    output: 4.4
See Custom Providers for more details on YAML configuration structure.

Troubleshooting

Authentication Errors

If you see authentication errors:
  1. Verify your API key is valid at OpenAI Platform
  2. Ensure the key has sufficient credits
  3. Check for any typos in the .env file

Rate Limits

OpenAI enforces rate limits based on your account tier. If you encounter rate limit errors:
  • Upgrade your OpenAI account tier for higher limits
  • Implement retry logic in your workflows
  • Consider using different models for different tasks to spread load

Model Availability

Some models may require specific API access:
  • o-series models require access to the OpenAI reasoning API
  • GPT-5 models may require beta access
Check your OpenAI account settings for model availability.

Build docs developers (and LLMs) love