feat: add OpenAI-compatible provider shim — use any LLM with Claude Code
Adds a new 'openai' API provider that translates Anthropic SDK calls to OpenAI chat completions format, enabling Claude Code's full tool system (bash, file read/write/edit, grep, glob, agents) with any OpenAI-compatible model: GPT-4o, DeepSeek, Gemini, Llama, Ollama, OpenRouter, and 200+ more. Set CLAUDE_CODE_USE_OPENAI=1, OPENAI_API_KEY, and OPENAI_MODEL to use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d2542c9a62
commit
619b5fb603
@@ -1728,12 +1728,13 @@ export function getSubscriptionName(): string {
|
||||
}
|
||||
}
|
||||
|
||||
/** Check if using third-party services (Bedrock or Vertex or Foundry) */
|
||||
/** Check if using third-party services (Bedrock or Vertex or Foundry or OpenAI-compatible) */
|
||||
export function isUsing3PServices(): boolean {
|
||||
return !!(
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) ||
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) ||
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY)
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) ||
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user