Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brandonbryant12/268846d31249d977dd353a5dbd98f1f6 to your computer and use it in GitHub Desktop.
Save brandonbryant12/268846d31249d977dd353a5dbd98f1f6 to your computer and use it in GitHub Desktop.
curl -H "Authorization: Bearer $OPENWEBUI_API_KEY" http://localhost:3000/api/models
# ----- 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