Skip to main content

Cyberstrike is now open source! AI-powered penetration testing for security professionals. Star on GitHub

OpenAI (GPT)

OpenAI provides GPT-4 and o1 models for security analysis. This guide covers setup and configuration.

📸 SCREENSHOT: openai-model-select.png

OpenAI model selection dialog

Available Models

ModelContextBest For
gpt-4o128KGeneral security testing
gpt-4o-mini128KQuick tasks, high volume
o1128KComplex reasoning
o1-mini128KFaster reasoning tasks
gpt-4-turbo128KBalanced performance

Authentication

API Key Setup

  1. Get your API key from platform.openai.com
  2. Run authentication:
Terminal window
cyberstrike auth login
# Select: OpenAI
# Enter your API key

Environment Variable

Terminal window
export OPENAI_API_KEY="sk-proj-..."

Configuration File

~/.cyberstrike/config.json
{
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}"
}
}
}
}

Model Configuration

Set Default Model

~/.cyberstrike/config.json
{
"model": "openai/gpt-4o"
}

Command Line Override

Terminal window
cyberstrike --model openai/o1

Using o1 Reasoning Models

o1 models excel at complex security analysis:

Terminal window
cyberstrike --model openai/o1

Best for:

  • Complex vulnerability chains
  • Attack path analysis
  • Cryptographic analysis
  • Reverse engineering

ChatGPT Plus/Pro

Use your ChatGPT subscription:

Terminal window
cyberstrike auth login
# Select: OpenAI
# Choose: ChatGPT Plus/Pro
# Complete browser authentication

Info

ChatGPT authentication requires browser-based OAuth flow.

Organization ID

For organization accounts:

~/.cyberstrike/config.json
{
"provider": {
"openai": {
"options": {
"apiKey": "{env:OPENAI_API_KEY}",
"organization": "org-..."
}
}
}
}

Custom Base URL

For OpenAI-compatible endpoints:

{
"provider": {
"openai": {
"options": {
"baseURL": "https://your-endpoint.com/v1"
}
}
}
}

Function Calling

GPT models support function calling for tool use:

{
"provider": {
"openai": {
"options": {
"parallelToolCalls": true
}
}
}
}

Rate Limits

OpenAI rate limits by tier:

TierRPMTPM
Free340,000
Tier 1500200,000
Tier 25,0002,000,000
Tier 3+Higher limits

Handling Limits

{
"provider": {
"openai": {
"options": {
"maxRetries": 3,
"timeout": 60000
}
}
}
}

Best Practices

Model Selection

TaskRecommended Model
Quick scansgpt-4o-mini
General testinggpt-4o
Complex analysiso1
Cost-sensitivegpt-4o-mini

Cost Optimization

  1. Use mini models for simple tasks
  2. Set reasonable max tokens
  3. Use /compact for long sessions
  4. Monitor usage on OpenAI dashboard

Security

  1. Store keys in environment variables
  2. Use project-specific API keys
  3. Enable usage limits in OpenAI dashboard
  4. Rotate keys periodically

Troubleshooting

Invalid API Key

Error: Incorrect API key provided

Verify:

  • Key starts with sk-proj- or sk-
  • No extra whitespace
  • Key is active

Insufficient Quota

Error: You exceeded your current quota

Solutions:

  • Add billing information
  • Check usage limits
  • Upgrade your plan

Model Access

Error: The model does not exist or you do not have access

Some models require:

  • Tier 3+ for o1
  • Waitlist approval
  • Enterprise agreement

Caution

o1 models have higher latency due to reasoning steps. Plan for longer response times.