Skip to main content

Quick Start

Version: 1.0 Last Updated: 2026-02-03 Estimated Time: 15 minutes


Welcome to AINative Studio!

This guide will help you get up and running with the AINative Studio API in less than 15 minutes. By the end, you'll have:

  • Created an account
  • Generated API credentials
  • Made your first API call
  • Built a simple AI-powered application

Prerequisites

Before you begin, make sure you have:

  • A valid email address
  • A code editor (VS Code recommended)
  • curl or Postman for testing
  • Python 3.8+ or Node.js 14+ (for SDK examples)

Step 1: Create Your Account (2 minutes)

Option A: Using curl

curl -X POST https://api.ainative.studio/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@example.com",
"password": "YourSecurePass123!",
"full_name": "Your Name"
}'

Option B: Using Python

import requests

response = requests.post(
"https://api.ainative.studio/v1/auth/register",
json={
"email": "your-email@example.com",
"password": "YourSecurePass123!",
"full_name": "Your Name"
}
)

user_data = response.json()
access_token = user_data["access_token"]
print(f"Access Token: {access_token}")

Success Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "your-email@example.com",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 28800
}

Save your access token - you'll need it for the next steps!


Step 2: Verify Your Token (1 minute)

Test that your authentication works:

curl https://api.ainative.studio/v1/auth/me \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Expected Response:

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "your-email@example.com",
"full_name": "Your Name",
"role": "USER",
"email_verified": false
}

Step 3: Create an API Key (2 minutes)

For production applications, use API keys instead of user tokens:

curl -X POST https://api.ainative.studio/v1/api-keys \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My First API Key",
"expires_in_days": 90
}'

Response:

{
"id": "key_123",
"api_key": "sk_live_abc123def456ghi789",
"name": "My First API Key",
"prefix": "sk_live",
"expires_at": "2026-05-03T00:00:00Z"
}

Important: Copy the api_key value immediately - it's only shown once!


Step 4: Create Your First Project (2 minutes)

Projects help organize your data and resources:

curl -X POST https://api.ainative.studio/v1/database/projects \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My First AI Project",
"description": "Getting started with AINative Studio"
}'

Response:

{
"id": "proj_abc123",
"name": "My First AI Project",
"description": "Getting started with AINative Studio",
"created_at": "2026-02-03T12:00:00Z"
}

Step 5: Make Your First AI Request (3 minutes)

Let's use the Chat Completion API to interact with an AI model:

Example: Simple Question

curl -X POST https://api.ainative.studio/v1/chat/completions \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "meta_llama",
"model": "Llama-3.3-70B-Instruct",
"messages": [
{
"role": "user",
"content": "Explain what AINative Studio is in one sentence"
}
]
}'

Python Example

import requests

response = requests.post(
"https://api.ainative.studio/v1/chat/completions",
headers={"Authorization": f"Bearer {access_token}"},
json={
"provider": "meta_llama",
"model": "Llama-3.3-70B-Instruct",
"messages": [
{
"role": "user",
"content": "Explain what AINative Studio is in one sentence"
}
]
}
)

result = response.json()
print(result["choices"][0]["message"]["content"])

Node.js Example

const axios = require('axios');

async function chatWithAI() {
const response = await axios.post(
'https://api.ainative.studio/v1/chat/completions',
{
provider: 'meta_llama',
model: 'Llama-3.3-70B-Instruct',
messages: [
{
role: 'user',
content: 'Explain what AINative Studio is in one sentence'
}
]
},
{
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
}
);

console.log(response.data.choices[0].message.content);
}

chatWithAI();

Step 6: Use Vector Search (5 minutes)

Store and search documents using semantic similarity:

A. Insert Documents

import requests

# Generate embeddings and store documents
documents = [
{
"id": "doc_1",
"content": "Python is a high-level programming language",
"metadata": {"category": "programming"}
},
{
"id": "doc_2",
"content": "Machine learning is a subset of artificial intelligence",
"metadata": {"category": "ai"}
}
]

# In a real application, you'd generate embeddings using an embedding model
# For this example, we'll use placeholder vectors
response = requests.post(
"https://api.ainative.studio/v1/vectors/upsert",
headers={"Authorization": f"Bearer {access_token}"},
json={
"project_id": "proj_abc123",
"collection": "knowledge_base",
"vectors": [
{
"id": doc["id"],
"vector": [0.1] * 384, # Replace with actual embeddings
"metadata": doc
}
for doc in documents
]
}
)

print("Documents inserted:", response.json())

B. Search Documents

# Search for similar documents
search_query = "What is AI?"

response = requests.post(
"https://api.ainative.studio/v1/vectors/search",
headers={"Authorization": f"Bearer {access_token}"},
json={
"project_id": "proj_abc123",
"collection": "knowledge_base",
"query_vector": [0.1] * 384, # Replace with query embedding
"limit": 5,
"min_score": 0.7
}
)

results = response.json()
for result in results["results"]:
print(f"Score: {result['score']}")
print(f"Content: {result['metadata']['content']}\n")

Common Use Cases

1. Chatbot Application

import requests

def create_chatbot(access_token):
"""Simple chatbot using AINative Studio"""
conversation_history = []

while True:
user_input = input("You: ")
if user_input.lower() == 'quit':
break

conversation_history.append({
"role": "user",
"content": user_input
})

response = requests.post(
"https://api.ainative.studio/v1/chat/completions",
headers={"Authorization": f"Bearer {access_token}"},
json={
"provider": "meta_llama",
"model": "Llama-3.3-70B-Instruct",
"messages": conversation_history
}
)

ai_message = response.json()["choices"][0]["message"]
conversation_history.append(ai_message)

print(f"AI: {ai_message['content']}\n")

# Run the chatbot
create_chatbot("YOUR_ACCESS_TOKEN")

2. Document Q&A System

def answer_question(question: str, documents: list, access_token: str):
"""Answer questions based on provided documents"""

# Create context from documents
context = "\n\n".join([doc["content"] for doc in documents])

# Ask AI to answer based on context
response = requests.post(
"https://api.ainative.studio/v1/chat/completions",
headers={"Authorization": f"Bearer {access_token}"},
json={
"provider": "meta_llama",
"model": "Llama-3.3-70B-Instruct",
"messages": [
{
"role": "system",
"content": f"Answer questions based on this context:\n{context}"
},
{
"role": "user",
"content": question
}
]
}
)

return response.json()["choices"][0]["message"]["content"]

# Example usage
documents = [
{"content": "Python was created by Guido van Rossum in 1991"},
{"content": "Python is known for its simple and readable syntax"}
]

answer = answer_question(
"Who created Python?",
documents,
"YOUR_ACCESS_TOKEN"
)
print(answer)

3. Code Analysis Tool

def analyze_code(code: str, access_token: str):
"""Analyze code for bugs and improvements"""

response = requests.post(
"https://api.ainative.studio/v1/chat/completions",
headers={"Authorization": f"Bearer {access_token}"},
json={
"provider": "meta_llama",
"model": "Llama-3.3-70B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a code review expert. Analyze code for bugs, security issues, and improvements."
},
{
"role": "user",
"content": f"Review this code:\n\n```python\n{code}\n```"
}
]
}
)

return response.json()["choices"][0]["message"]["content"]

# Example usage
code_to_review = """
def process_user_input(user_input):
result = eval(user_input)
return result
"""

analysis = analyze_code(code_to_review, "YOUR_ACCESS_TOKEN")
print(analysis)

Environment Setup

Setting Up Environment Variables

Create a .env file in your project:

# .env
AINATIVE_API_KEY=sk_live_your_api_key_here
AINATIVE_BASE_URL=https://api.ainative.studio/v1

Python Setup

# config.py
import os
from dotenv import load_dotenv

load_dotenv()

AINATIVE_API_KEY = os.getenv("AINATIVE_API_KEY")
AINATIVE_BASE_URL = os.getenv("AINATIVE_BASE_URL")

# api_client.py
import requests
from config import AINATIVE_API_KEY, AINATIVE_BASE_URL

class AINativeClient:
def __init__(self):
self.api_key = AINATIVE_API_KEY
self.base_url = AINATIVE_BASE_URL

def chat(self, messages, model="Llama-3.3-70B-Instruct"):
response = requests.post(
f"{self.base_url}/chat/completions",
headers={"Authorization": f"Bearer {self.api_key}"},
json={
"provider": "meta_llama",
"model": model,
"messages": messages
}
)
return response.json()

# Usage
client = AINativeClient()
result = client.chat([{"role": "user", "content": "Hello!"}])
print(result["choices"][0]["message"]["content"])

Node.js Setup

// config.js
require('dotenv').config();

module.exports = {
AINATIVE_API_KEY: process.env.AINATIVE_API_KEY,
AINATIVE_BASE_URL: process.env.AINATIVE_BASE_URL
};

// api-client.js
const axios = require('axios');
const { AINATIVE_API_KEY, AINATIVE_BASE_URL } = require('./config');

class AINativeClient {
constructor() {
this.apiKey = AINATIVE_API_KEY;
this.baseUrl = AINATIVE_BASE_URL;
}

async chat(messages, model = 'Llama-3.3-70B-Instruct') {
const response = await axios.post(
`${this.baseUrl}/chat/completions`,
{
provider: 'meta_llama',
model: model,
messages: messages
},
{
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
}
}
);
return response.data;
}
}

// Usage
const client = new AINativeClient();
client.chat([{ role: 'user', content: 'Hello!' }])
.then(result => console.log(result.choices[0].message.content));

Next Steps

Now that you've completed the quick start, here's what to explore next:

  1. Authentication Guide - Learn about OAuth2, API key rotation, and security best practices

    • See: /docs/guides/AUTHENTICATION.md
  2. Developer API Reference - Complete documentation of developer earnings, markup, and analytics

    • See: /docs/api/DEVELOPER_API_REFERENCE.md
  3. Code Examples - More advanced examples and patterns

    • See: /docs/examples/
  4. Troubleshooting - Common issues and solutions

    • See: /docs/guides/TROUBLESHOOTING.md
  5. Agent Framework - Build multi-agent systems

    • See: /docs/guides/AGENT_FRAMEWORK.md
  6. ZeroDB Guide - Advanced database operations

    • See: /docs/examples/ZERODB_EXAMPLES.md

Getting Help

If you run into issues:

  1. Check the Troubleshooting Guide
  2. Search GitHub Issues
  3. Email support: support@ainative.studio
  4. Join our Discord community

API Rate Limits

Your free tier includes:

  • 60 requests/minute
  • 1,000 requests/hour
  • 10,000 requests/day

Need more? Upgrade to Pro or Enterprise:


Security Best Practices

  1. Never commit API keys to version control
  2. Use environment variables for credentials
  3. Rotate keys regularly (every 90 days recommended)
  4. Use HTTPS for all API calls
  5. Implement rate limiting in your application
  6. Validate all inputs before sending to API
  7. Monitor usage through the dashboard

Quick Reference

Authentication

# Register
POST /v1/auth/register

# Login
POST /v1/auth/login-json

# Get user info
GET /v1/auth/me

Projects

# List projects
GET /v1/database/projects

# Create project
POST /v1/database/projects

AI Chat

# Chat completion
POST /v1/chat/completions
# Insert vectors
POST /v1/vectors/upsert

# Search vectors
POST /v1/vectors/search

Congratulations! You're now ready to build AI-powered applications with AINative Studio.


Developer Monetization

Want to earn from your applications? Set up developer markup and track earnings:

  1. Configure Markup - Set your developer markup (0-40%)

    curl -X PUT https://api.ainative.studio/v1/developer/markup \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"developer_markup": 15.0}'
  2. Track Earnings - Monitor your earnings

    curl https://api.ainative.studio/v1/developer/earnings \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  3. Setup Payouts - Configure Stripe Connect for payouts

    curl -X POST https://api.ainative.studio/v1/developer/earnings/connect/onboard \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

For complete developer earnings documentation, see Developer API Reference.


Last Updated: 2026-02-04 Version: 1.1

Refs #1015