Quick Setup Guide

Get started with Tav-AI in just a few minutes. Follow this guide to create your account, generate an API key, and make your first request.

Step 1: Create Your Account

First, you'll need to create a Tav-AI account to access the API and manage your usage.

  1. Visit the Tav-AI Dashboard
  2. Login with your Discord Account
  3. Authorize Discord Login

Step 2: Generate Your API Key

Once you have an account, you'll need to generate an API key to authenticate your requests.

  1. Log in to your dashboard
  2. Navigate to the "API Keys" section
  3. Click "Create New Key"
  4. Customize your key as you see fit
  5. Copy and securely store your API key

⚠️ Important Security Note

Keep your API key secure and never share it publicly. Treat it like a password. If you suspect your key has been compromised, revoke it immediately and generate a new one.

Step 3: Make Your First Request

Now you're ready to make your first API call. Here are examples in different programming languages:

cURL Example
curl -X POST "https://api.tav-ai.com/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ],
    "max_tokens": 100
  }'
Python Example
import requests
import json

api_key = "YOUR_API_KEY"
url = "https://api.tav-ai.com/v1/chat/completions"

headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

data = {
    "model": "gpt-4o-mini",
    "messages": [
        {
            "role": "user",
            "content": "Hello, how are you?"
        }
    ],
    "max_tokens": 100
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result["choices"][0]["message"]["content"])
JavaScript (Node.js) Example
const axios = require('axios');

const apiKey = 'YOUR_API_KEY';
const url = 'https://api.tav-ai.com/v1/chat/completions';

const headers = {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
};

const data = {
    model: 'gpt-4o-mini',
    messages: [
        {
            role: 'user',
            content: 'Hello, how are you?'
        }
    ],
    max_tokens: 100
};

axios.post(url, data, { headers })
    .then(response => {
        console.log(response.data.choices[0].message.content);
    })
    .catch(error => {
        console.error('Error:', error.response.data);
    });

Step 4: Using OpenAI SDK

Tav-AI is compatible with the OpenAI SDK. Simply change the base URL to use our API:

Python with OpenAI SDK
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.tav-ai.com/v1"
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "user",
            "content": "Hello, how are you?"
        }
    ],
    max_tokens=100
)

print(response.choices[0].message.content)
JavaScript with OpenAI SDK
import OpenAI from 'openai';

const openai = new OpenAI({
    apiKey: 'YOUR_API_KEY',
    baseURL: 'https://api.tav-ai.com/v1'
});

const response = await openai.chat.completions.create({
    model: 'gpt-4o-mini',
    messages: [
        {
            role: 'user',
            content: 'Hello, how are you?'
        }
    ],
    max_tokens: 100
});

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

Environment Variables

For security best practices, store your API key as an environment variable:

.env file
TAV_AI_API_KEY=your_actual_api_key_here
Python with environment variable
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("TAV_AI_API_KEY"),
    base_url="https://api.tav-ai.com/v1"
)

Next Steps

Congratulations! You've successfully set up Tav-AI and made your first request. Here's what to explore next:

🤖 Explore Models

Learn about the different AI models available and their capabilities.

View Models →

💬 Chat Completions

Dive deep into the chat completions API and advanced parameters.

Learn More →

📊 Dashboard

Monitor your usage, manage API keys, and view analytics.

Open Dashboard →