Lunos

Documentation

Quick Start Guide

This guide will help you get up and running with Lunos AI Platform in just a few minutes. Follow these simple steps to start integrating AI capabilities into your applications.

Note: This guide assumes you have already created a Lunos account. Checking authentication status...

1

Create an API Key

To use the Lunos API, you'll need an API key. You can create one from your dashboard:

  1. Go to your API Keys page
  2. Click on "Create New API Key"
  3. Give your key a descriptive name (e.g., "Development Key")
  4. Set appropriate permissions and limits
  5. Copy your API key and store it securely

Important: Your API key is sensitive information. Never share it publicly or commit it to version control.

2

Install the Client Library

The easiest way to use the Lunos API in JavaScript/TypeScript is with our official client library: @lunos/client.

JavaScript/TypeScript (Recommended)

npm install @lunos/client

Python

pip install openai

Note: @lunos/client is the official and recommended package for JavaScript/TypeScript. You can also use the OpenAI library for compatibility, or use cURL/Python for other languages.

3

Initialize the Client

Initialize the Lunos client with your API key:

JavaScript/TypeScript (@lunos/client)

Initialize Client (JavaScript)
1import { LunosClient } from '@lunos/client';
2
3const client = new LunosClient({
4  apiKey: 'your_api_key_here',
5  baseURL: 'https://api.lunos.tech/v1',
6  appId: 'your_app_id_here', // optional
7});

Note: The appId is optional and can be used to track usage of your application.

Python

Initialize Client (Python)
1from openai import OpenAI
2
3client = OpenAI(
4    api_key="your_api_key_here",
5    base_url="https://api.lunos.tech/v1",
6    default_headers={
7      "X-App-ID": "your_app_id_here" // optional
8    }
9)

Note: The X-App-ID header is optional and can be used to track usage of your application.

4

Make Your First API Call

Let's make a simple API call to generate a text completion:

JavaScript/TypeScript (@lunos/client)

Generate Completion (JavaScript)
1import { LunosClient } from '@lunos/client';
2
3const client = new LunosClient({
4  apiKey: 'your_api_key_here',
5  baseURL: 'https://api.lunos.tech/v1',
6  appId: 'your_app_id_here', // optional
7});
8
9async function generateCompletion() {
10  try {
11    const response = await client.chat.createCompletion({
12      model: 'openai/gpt-4o',
13      messages: [
14        { role: 'user', content: 'Write a short poem about artificial intelligence.' }
15      ],
16      max_tokens: 150,
17      temperature: 0.7,
18    });
19    console.log(response.choices[0].message.content);
20  } catch (error) {
21    console.error('Error:', error);
22  }
23}
24
25generateCompletion();

Python

Generate Completion (Python)
1def generate_completion():
2    try:
3        response = client.completions.create(
4            model="openai/gpt-4o",
5            prompt="Write a short poem about artificial intelligence.",
6            max_tokens=150,
7            temperature=0.7
8        )
9        print(response.choices[0].message.content)
10    except Exception as e:
11        print(f"Error: {e}")
12
13generate_completion()
5

Explore More Features

Congratulations! You've made your first API call to Lunos. Now you can explore more features and capabilities:

  • API Reference - Explore all available endpoints and parameters
  • Models - Discover all available AI models
  • FAQ - Find answers to common questions

Need Help?

If you encounter any issues or have questions, our support team is here to help.