Get started
Get up and running with our API in minutes.
The LuneAI API is a RESTful API that is built on top of LLM providers like OpenAI and Anthropic that allows you to access Lunes and Tycho through HTTP requests.
Information:
The API is only available for Pro users to experiment with, and we do not recommend using it in production unless you have been specially onboarded.
API Keys
The LuneAI API uses API keys for authentication, which can be one of two types:
- Personal Key: For individual use with external AI tools and copilots. For example, Cursor. API responses when using this key are modified to work within third-party applications and aren't standard. Read
Personal API Keys
- Project Key: For all other standard API use. Higher default rate limits and designed to be hot-swappable with OpenAI chat completions endpoints. Read
Project API Keys
Important:
The behavior of the API when using a personal
vs a project
key is different. Read API Keys for their distinctions.
1: Getting your keys
To generate both Personal
and Project
keys, login and navigate to your profile and click Generate for your key type.
2: Include your API key in your header
Make sure all API requests have the following Authorization header:
Authorization: Bearer LUNE_API_KEY
Example Request
curl https://api.trylune.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LUNE_API_KEY" \
-d '{
"messages": [
{"role": "user", "content": "What is the format of the AIMessageChunk object in Langchain?"}
],
"model": "tycho",
"stream": true
}'