curl
Ready-to-use recipes for the command line. Set your key once:
export NORLEN_API_KEY="sk-..."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!"}]}'Streaming
Section titled “Streaming”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}'Embeddings
Section titled “Embeddings”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"}'Models
Section titled “Models”curl https://api.norlen.io/v1/models \ -H "Authorization: Bearer $NORLEN_API_KEY"Images
Section titled “Images”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:
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']))"