Lunos logoLunos

Quickstart

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.

Video: integrate with JavaScript and Python

1. Create an API key

  1. Open API Keys.
  2. Choose Create New API Key.
  3. Name it (for example development-laptop).
  4. Set limits and permissions that match this environment.
  5. Copy the key once and store it in a password manager or secret store.

Important: Keys are secrets. Do not commit them to git or expose them in frontend bundles.

2. Install a client

Note: @lunos/client is the first-party SDK for TS/JS. For Python and other languages you can use the OpenAI SDK against the Lunos base URL, or plain HTTP.

Warning: The npm package may lag behind the live API and can fail for newer endpoints or options. If you hit errors, switch to the OpenAI JavaScript SDK with baseURL: "https://api.lunos.tech/v1" and your Lunos API key, or use raw HTTP.

pnpm add @lunos/client
pip install openai

3. Configure the client

import { LunosClient } from "@lunos/client";

const client = new LunosClient({
  apiKey: process.env.LUNOS_API_KEY!,
  baseURL: "https://api.lunos.tech/v1",
  appId: "my-app-v1", // optional, for analytics
});
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
)

4. Make your first call

const response = await client.chat.createCompletion({
  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);
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)

5. Explore further

6. Enable observability for debugging (optional)

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?" }],
});
response = 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.


Need help?

Email hello@lunos.tech or read the FAQ.