| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Welcome to the lobe2api, offering free self-hosted API access to lobe-chat with OpenAI's familiar structure, so no code changes are needed.
Ensure Docker is installed by referring to the Docker Installation Docs.
Clone repository
git clone https://github.com/k0baya/lobe2api.git && cd lobe2apiEdit the .env file.
Run the following command:
docker compose up -dDone! You can now connect to your local server's API at:
http://localhost:3000/v1/chat/completions
Note that the base URL is http://localhost:PORT/v1.
Edit the .env file, add variables such as PORT 、 BASE_URL 、 AUTH_TOKEN .
| Key | Default Value | Note |
|---|---|---|
| PORT | 3000 | Port that lobe2api listens on |
| BASE_URL | http://localhost:1234 | That lobe-chat url that you need to reverse |
| AUTH_TOKEN | Authentication for your lobe2api | |
| ACCESS_CODE | The access code for the lobe-chat url that you need to reverse |
Run the following command:
npm install
npm run startDone! You can now connect to your local server's API at:
http://localhost:PORT/v1/chat/completions
Note that the base URL is http://localhost:PORT/v1.
Leverage the same integration code as OpenAI's official libraries by simply adjusting the API key and base URL in your requests. For self-hosted setups, ensure to switch the base URL to your local server's address as mentioned above.
curl --location 'http(s)://localhost:PORT/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AUTH_TOKEN' \
--data '{
"model": "gpt-3.5-turbo",
"stream": true,
"messages": [{"role": "user", "content": "Tell me a story about socialism."}]
}'This repository is under the AGPL-3.0 License. Refer to the LICENSE file for detailed information.
| Back | FazBrowse Home | New Git URL |