mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
191f3fe776
* 📝 docs: fix outdated content across the docs site Audited docs/ against the current codebase and fixed stale content that drifted after major refactors (Clerk/NextAuth → Better Auth, src/server → apps/server, src/{config,envs,locales} → packages/*, model-bank updates). - self-hosting/auth: mark removed NextAuth/Clerk pages with deprecation warnings; fix microsoft/zitadel alias claims and the Logto callback path - environment-variables & advanced: correct wrong defaults (S3_SET_ACL, AI_IMAGE_DEFAULT_IMAGE_NUM, index/proxy URLs), drop non-existent env vars and fictional feature flags, fix OIDC config guidance - development: update refactored paths, Better Auth, .mjs configs, remove the MSW section (msw is not a dependency) - providers & model examples: replace retired model ids with in-bank ones; fix comfyui frontmatter corruption - usage: rename Moderator→Orchestrator, GTD→Task, correct shortcut keys, channel capability tables, Feishu/Lark WebSocket mode - platform/migration: fix dead links, docker service name, npx/npm → bun EN and zh-CN pairs updated together. * 📝 docs: fix Logto callback path and AUTH_SECRET deprecation guidance - Revert Logto/Sealos callback URLs to /api/auth/callback/logto to match the runtime SSO redirectURI override - Narrow legacy auth Callout: AUTH_SECRET remains required for Better Auth; mark NEXT_AUTH_SECRET as deprecated in zh-CN * 📝 docs: refresh agent skills for locales, env, auth, and agentRun paths Align OSS agent guidance with post-refactor layout: - packages/locales/src/default + bun run i18n - packages/env/src for env schemas (@/envs alias) - spa-auth shell + src/routes/auth segments - chat agentRun/transports/hetero instead of aiChat * 📝 docs: document APP_URL as required for Better Auth base URL Self-hosted auth uses appEnv.APP_URL as baseURL, not request-header auto-detection. NEXT_PUBLIC_AUTH_URL remains deprecated. * 📝 docs: note self-host search provider setup for web search Built-in lobe-web-browsing needs no client plugin, but self-hosted servers still require SEARCH_PROVIDERS / SEARXNG_URL (default SearXNG). * 📝 docs: point feature guide welcome UI at AgentHome Opening message/questions on the agent chat page live in src/features/AgentHome, not Onboarding WelcomeMessage.
79 lines
2.3 KiB
Plaintext
79 lines
2.3 KiB
Plaintext
---
|
||
title: Using OpenAI API Key in LobeHub
|
||
description: >-
|
||
Learn how to configure and use your OpenAI API Key in LobeHub, supporting
|
||
GPT-4o / GPT-4-turbo / GPT-4.1
|
||
tags:
|
||
- ChatGPT
|
||
- GPT-4
|
||
- GPT-4o
|
||
- API Key
|
||
- Web UI
|
||
---
|
||
|
||
# Using OpenAI in LobeHub
|
||
|
||
<Image alt={'Using OpenAI in LobeHub'} cover src={'/blog/assets17870709/c9e5eafc-ca22-496b-a88d-cc0ae53bf720.webp'} />
|
||
|
||
This guide will walk you through how to use [OpenAI](https://openai.com/) in LobeHub:
|
||
|
||
<Steps>
|
||
### Step 1: Get Your OpenAI API Key
|
||
|
||
- Sign up for an [OpenAI account](https://platform.openai.com/signup). You’ll need an international phone number and a non-mainland China email address.
|
||
|
||
- After signing up, go to the [API Keys](https://platform.openai.com/api-keys) page and click `Create new secret key` to generate a new API key:
|
||
|
||
- Open the key creation window
|
||
|
||
<Image
|
||
alt={'Open the key creation window'}
|
||
inStep
|
||
src={
|
||
'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png'
|
||
}
|
||
/>
|
||
|
||
- Create your API key
|
||
|
||
<Image
|
||
alt={'Create your API key'}
|
||
inStep
|
||
src={
|
||
'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png'
|
||
}
|
||
/>
|
||
|
||
- Copy and save your API key
|
||
|
||
<Image
|
||
alt={'Copy and save your API key'}
|
||
inStep
|
||
src={
|
||
'https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png'
|
||
}
|
||
/>
|
||
|
||
<Callout type={'warning'}>
|
||
New accounts typically receive $5 in free credits, valid for three months.
|
||
</Callout>
|
||
|
||
### Step 2: Configure OpenAI in LobeHub
|
||
|
||
- Open the `Settings` panel in LobeHub
|
||
- Under `AI Providers`, locate the `OpenAI` section
|
||
|
||
<Image alt={'Enter your API key'} inStep src={'/blog/assets17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa.webp'} />
|
||
|
||
- Paste your API key into the input field
|
||
- Choose an OpenAI model for your AI assistant to start chatting
|
||
|
||
<Image alt={'Select an OpenAI model and start chatting'} inStep src={'/blog/assets17870709/ff7ebacf-27f0-42d7-810b-00314499a084.webp'} />
|
||
|
||
<Callout type={'warning'}>
|
||
You may incur charges while using the API. Please refer to OpenAI’s pricing policy for details.
|
||
</Callout>
|
||
</Steps>
|
||
|
||
That’s it! You’re now ready to use OpenAI models in LobeHub for conversations.
|