Skip to content

feat: add custom API base URL support for OpenAI-compatible wrappers#7

Open
aaronlippold wants to merge 3 commits intosteveyegge:mainfrom
aaronlippold:feature/custom-api-endpoint
Open

feat: add custom API base URL support for OpenAI-compatible wrappers#7
aaronlippold wants to merge 3 commits intosteveyegge:mainfrom
aaronlippold:feature/custom-api-endpoint

Conversation

@aaronlippold
Copy link
Copy Markdown

Summary

Add support for custom API base URLs, enabling VC to work with OpenAI-compatible API wrappers like claude-code-openai-wrapper.

Changes:

  • Add BaseURL field to ai.Config struct
  • Check VC_API_BASE environment variable if BaseURL not provided
  • Use option.WithBaseURL() when creating Anthropic client
  • Fix missing APIKey in circuit breaker tests (pre-existing bug)
  • Run go fmt on internal/ai package

Usage:

export VC_API_BASE=http://localhost:8000
vc list  # Now uses custom endpoint

Test Plan

  • Unit tests for BaseURL configuration
  • Integration test with API wrapper
  • All existing tests pass (fixed pre-existing failures)
  • go fmt and golangci-lint clean

Authored by: Aaron Lippoldlippold@gmail.com

Add BaseURL field to Config struct and VC_API_BASE environment variable
support. This enables using VC with OpenAI-compatible API wrappers like
claude-code-openai-wrapper for multi-agent workflows.

- Add BaseURL field to ai.Config struct
- Check VC_API_BASE env var if BaseURL not provided in config
- Use option.WithBaseURL() when creating Anthropic client
- Log when custom base URL is active

Authored by: Aaron Lippold<lippold@gmail.com>
- Add baseurl_test.go with unit tests for Config.BaseURL handling
- Add baseurl_integration_test.go for testing with actual API wrapper
- Tests verify config precedence (Config.BaseURL > VC_API_BASE env var)

Authored by: Aaron Lippold<lippold@gmail.com>
- Add APIKey: "test-key" to TestCircuitBreakerWithRetry tests
- Add APIKey: "test-key" to TestCircuitBreakerDisabled test
- Run go fmt on all internal/ai files
- All tests now pass

Authored by: Aaron Lippold<lippold@gmail.com>
@aaronlippold
Copy link
Copy Markdown
Author

Related PR: RichardAtCT/claude-code-openai-wrapper#31

This PR works in conjunction with the wrapper PR above. Together they enable VC to leverage Claude Code's tool execution capabilities (file read/write, bash, etc.) through the wrapper service.

Integration flow:

  1. Wrapper runs at localhost:8000 with /v1/messages endpoint (Anthropic SDK compatible)
  2. VC configured with VC_API_BASE=http://localhost:8000
  3. VC's AI calls route through wrapper → Claude Code CLI → tool execution

This enables multi-agent workflows where VC can orchestrate Claude Code for more sophisticated automation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant