Skip to content

feat(api): support custom OpenAI-compatible endpoints - #125

Open
TomCN0803 wants to merge 1 commit into
openai:mainfrom
TomCN0803:feat/custom-api-endpoint
Open

feat(api): support custom OpenAI-compatible endpoints#125
TomCN0803 wants to merge 1 commit into
openai:mainfrom
TomCN0803:feat/custom-api-endpoint

Conversation

@TomCN0803

Copy link
Copy Markdown

Summary

Allow users to point codex-security at a custom OpenAI-compatible LLM endpoint. #52

Changes

  • CodexSecurityConfig now accepts optional endpoint field (src/config.ts)
  • Passes baseUrl through to @openai/codex-sdk in api.ts
  • openai_base_url whitelisted in scanPreflightCodexConfig so it survives --codex override sanitization
  • New --endpoint CLI flag on scan and bulk-scan commands
  • CODEX_ENDPOINT environment variable support (CLI flag takes priority)
  • Tests for config, preflight sanitization, and parseCodexOverrides

Usage

# CLI flag
codex-security scan . --endpoint https://my-llm.example.com/v1

# Environment variable
CODEX_ENDPOINT=https://my-llm.example.com/v1 codex-security scan .

# Bulk scan
codex-security bulk-scan repos.csv --output-dir ./results --endpoint https://my-llm.example.com/v1

# Via --codex override
codex-security scan . --codex 'openai_base_url="https://my-llm.example.com/v1"'

@mldangelo-oai mldangelo-oai added the enhancement New feature or request label Aug 3, 2026
@mldangelo-oai mldangelo-oai changed the title feat: custom API endpoint feat(api): support custom OpenAI-compatible endpoints Aug 3, 2026
@qthequartermasterman

Copy link
Copy Markdown

@TomCN0803 Any chance you plan on merging the changes from main/rebasing this?

@TomCN0803
TomCN0803 force-pushed the feat/custom-api-endpoint branch from b09d7e0 to a212f90 Compare September 3, 2026 09:33

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--endpoint is passed to the live Codex client as baseUrl, but it never enters effectiveConfig / preflightConfig. Scan registration and rerun paths persist/reuse that sanitized config, so a scan started with --endpoint can later lose the custom endpoint while the equivalent --codex openai_base_url=... survives. Could the endpoint be persisted explicitly (or injected as openai_base_url) with a rerun regression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants