Setting one
In a macOS or Linux shell, for the current session:
export LUV13_API_KEY="paste-your-key-here"To keep it across sessions, add that line to your shell profile, such as ~/.zshrc or ~/.bashrc.
On Windows PowerShell, for the current session:
$env:LUV13_API_KEY = "paste-your-key-here"Using a .env file
Many projects keep local settings in a .env file and load it with a library such as python-dotenv or Node's --env-file flag. If you do:
- Add
.envto.gitignorebefore you create it. - Commit a
.env.examplewith the variable names and no real values.
Reading it in code
import os
key = os.environ["LUV13_API_KEY"] # fails loudly if it's missingconst key = process.env.LUV13_API_KEY;
if (!key) throw new Error("LUV13_API_KEY is not set");Example
Once the variable is set, the shell fills it in for you:
curl https://api.luv13.ai/v1/chat/completions \
-H "Authorization: Bearer $LUV13_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "luv13/glm-5.3-flash", "messages": [{"role": "user", "content": "Hi"}]}'For more on keeping keys safe, see API Key Best Practices.
