1. Use environment variables
.env to .gitignore.
2. Pick the right model for the job
Don’t use a $0.015 model for simple tasks:3. Use streaming for chat UIs
Users hate waiting for a full response. Stream it:4. Retry on 429s and 5xx
5. Monitor costs
Every response tells you what it cost. Log it:6. Proxy for browser apps
Never put your API key in frontend code:7. Use separate keys per environment
dev-keyfor developmentprod-keyfor production- Revoke one without affecting the other