Follow these steps to send your first successful request through Lunos. This guide assumes you can run shell commands locally.
Note: You need a Lunos account. Create one if you have not already, then open the dashboard.
development-laptop).Important: Keys are secrets. Do not commit them to git or expose them in frontend bundles.
JavaScript / TypeScript (recommended)
pnpm add @lunos/sdk
Python (OpenAI-compatible SDK)
pip install openai
Note:
@lunos/sdkis the official SDK for TS/JS. For Python and other languages you can use the OpenAI SDK against the Lunos base URL, or plain HTTP.
JavaScript / TypeScript
import Lunos from "@lunos/sdk";
const client = new Lunos({
apiKey: process.env.LUNOS_API_KEY!,
baseURL: "https://api.lunos.tech/v1",
appId: "my-app-v1", // optional, for analytics
});
Python
from openai import OpenAI
client = OpenAI(
api_key="your_api_key_here",
base_url="https://api.lunos.tech/v1",
default_headers={"X-App-ID": "my-app-v1"}, # optional
)
JavaScript / TypeScript
const response = await client.chat.completions.create({
model: "openai/gpt-4o",
messages: [
{
role: "user",
content: "Write a short poem about artificial intelligence.",
},
],
max_tokens: 150,
temperature: 0.7,
});
console.log(response.choices[0].message.content);
Python
response = client.chat.completions.create(
model="openai/gpt-4o",
messages=[
{"role": "user", "content": "Write a short poem about artificial intelligence."},
],
max_tokens=150,
temperature=0.7,
)
print(response.choices[0].message.content)
Add observability: true to a completion request when you need deeper inspection for a specific call.
const response = await client.chat.completions.create({
model: "google/gemma-4-26b-a4b-it",
observability: true,
messages: [{ role: "user", content: "Can you jogging?" }],
});
Then open Dashboard → Logs, click Detail on that request row, and inspect structured request/output/usage data.
Email hello@lunos.tech or read the FAQ.
No headings found on this page.
