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

Lunos provides client libraries for various programming languages. Choose the one that fits your stack:

JavaScript/TypeScript (Node.js)

npm install openai

Python

pip install openai

Note: We recommend using the OpenAI library as our official package is still under development. The OpenAI library provides excellent compatibility with the Lunos API.

3

Initialize the Client

Initialize the Lunos client with your API key:

JavaScript/TypeScript

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

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)
4

Make Your First API Call

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

JavaScript/TypeScript

Generate Completion (JavaScript)
1async function generateCompletion() {
2  try {
3    const response = await 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    
10    console.log(response.choices[0].message.content);
11  } catch (error) {
12    console.error("Error:", error);
13  }
14}
15
16generateCompletion();

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        
10        print(response.choices[0].message.content)
11    except Exception as e:
12        print(f"Error: {e}")
13
14generate_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
  • Best Practices - Learn how to use Lunos effectively
  • 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.