curl
Receitas prontas para a linha de comando. Defina sua key uma vez:
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":"Olá!"}]}'Streaming
Seção intitulada “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":"Olá!"}],"stream":true}'Embeddings
Seção intitulada “Embeddings”curl https://api.norlen.io/v1/embeddings \ -H "Authorization: Bearer $NORLEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"qwen3-embedding","input":"texto para vetorizar"}'Modelos
Seção intitulada “Modelos”curl https://api.norlen.io/v1/models \ -H "Authorization: Bearer $NORLEN_API_KEY"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":"Um farol ao amanhecer","size":"1024x1024"}'A imagem volta em data[0].b64_json (PNG em base64). Para salvar direto:
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":"Um farol ao amanhecer"}' \ | python3 -c "import sys,json,base64;open('imagem.png','wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"