Created
July 25, 2025 01:15
-
-
Save brandonbryant12/268846d31249d977dd353a5dbd98f1f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -H "Authorization: Bearer $OPENWEBUI_API_KEY" http://localhost:3000/api/models | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ----- edit these two lines only --------------------------------- | |
| API_URL="http://localhost:3000/api" # ← your Open-WebUI base (note the /api) | |
| API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # ← your token | |
| # ----------------------------------------------------------------- | |
| curl -sS -X POST "$API_URL/chat/completions" \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer $API_KEY" \ | |
| -d '{ | |
| "model": "llama3.1", /* match the id returned by /api/models */ | |
| "messages": [ | |
| { "role": "system", "content": "You are a helpful assistant." }, | |
| { "role": "user", "content": "Hello! How are you?" } | |
| ], | |
| "temperature": 0.7 | |
| }' | jq . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment