Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ NEXT_PUBLIC_OLLAMA_URL=http://localhost:11434

# API Keys (Optional: Entering an API key here overrides the API keys globally for all users.)
OPENAI_API_KEY=
# Optional: OpenAI-compatible API base URL override (e.g. https://api.openai.com/v1)
OPENAI_BASE_URL=
ANTHROPIC_API_KEY=
GOOGLE_GEMINI_API_KEY=
MISTRAL_API_KEY=
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ In environment variables, add the following from the values you got above:
You can also add API keys as environment variables.

- `OPENAI_API_KEY`
- `OPENAI_BASE_URL` (optional, for OpenAI-compatible endpoints)
- `AZURE_OPENAI_API_KEY`
- `AZURE_OPENAI_ENDPOINT`
- `AZURE_GPT_45_VISION_NAME`
Expand Down
3 changes: 2 additions & 1 deletion app/api/chat/openai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export async function POST(request: Request) {

const openai = new OpenAI({
apiKey: profile.openai_api_key || "",
organization: profile.openai_organization_id
organization: profile.openai_organization_id,
baseURL: process.env.OPENAI_BASE_URL || undefined
})

const response = await openai.chat.completions.create({
Expand Down