Skip to content

curl

Ready-to-use recipes for the command line. Set your key once:

Terminal window
export NORLEN_API_KEY="sk-..."
Terminal window
curl https://api.norlen.io/v1/chat/completions \
-H "Authorization: Bearer $NORLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3.6-35b","messages":[{"role":"user","content":"Hello!"}]}'
Terminal window
curl https://api.norlen.io/v1/chat/completions \
-H "Authorization: Bearer $NORLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3.6-35b","messages":[{"role":"user","content":"Hello!"}],"stream":true}'
Terminal window
curl https://api.norlen.io/v1/embeddings \
-H "Authorization: Bearer $NORLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-embedding","input":"text to embed"}'
Terminal window
curl https://api.norlen.io/v1/models \
-H "Authorization: Bearer $NORLEN_API_KEY"
Terminal window
curl https://app.norlen.io/api/v1/images/generations \
-H "Authorization: Bearer $NORLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image","prompt":"A lighthouse at dawn","size":"1024x1024"}'

The image comes back in data[0].b64_json (base64 PNG). To save it directly:

Terminal window
curl -s https://app.norlen.io/api/v1/images/generations \
-H "Authorization: Bearer $NORLEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen-image","prompt":"A lighthouse at dawn"}' \
| python3 -c "import sys,json,base64;open('imagem.png','wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"