Quickstart
This guide will help you make your first API call with Lunar SDK.1. Install the SDK
2. Set Your API Key
Set theLUNAR_API_KEY environment variable:
3. Make Your First Request
Chat Completion
Text Completion
4. Check Cost and Usage
Every response includes detailed usage information:5. Use Fallbacks
Add fallback models to automatically retry if the primary model fails:6. Async Usage
For async applications, useAsyncLunar: