All Tutorials
API

🔑 API Quickstart

Get your API key and make your first programmatic request to Vigthoria in under 10 minutes.

10 min Beginner
1

Get Your API Key

  1. Log in to your Vigthoria account at vigthoria.io
  2. Navigate to Account Settings → API Keys
  3. Click "Create New API Key"
  4. Give your key a descriptive name (e.g., "Development Key")
  5. Copy the key immediately — you won't see it again!
Security Warning

Never share your API key or commit it to version control. Use environment variables to store it securely.

2

Set Up Your Environment

Store your API key as an environment variable:

Bash / Terminal
# Add to your .bashrc, .zshrc, or .env file
export VIGTHORIA_API_KEY="vg-live-sk-your-key-here"
Windows PowerShell
# Set environment variable
$env:VIGTHORIA_API_KEY = "vg-live-sk-your-key-here"
3

Make Your First Request

The Vigthoria API follows REST conventions. Here's the base URL:

BASE https://api.vigthoria.io/v1

Let's make a simple chat completion request:

cURL
curl https://api.vigthoria.io/v1/chat/completions \
  -H "Authorization: Bearer $VIGTHORIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "v2-reasoning",
    "messages": [
      {"role": "user", "content": "Hello, Vigthoria!"}
    ]
  }'
Python
import os
import requests

api_key = os.environ.get("VIGTHORIA_API_KEY")

response = requests.post(
    "https://api.vigthoria.io/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    },
    json={
        "model": "v2-reasoning",
        "messages": [
            {"role": "user", "content": "Hello, Vigthoria!"}
        ]
    }
)

print(response.json())
JavaScript / Node.js
const response = await fetch('https://api.vigthoria.io/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.VIGTHORIA_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'v2-reasoning',
    messages: [
      { role: 'user', content: 'Hello, Vigthoria!' }
    ]
  })
});

const data = await response.json();
console.log(data);
4

Understand the Response

A successful response looks like this:

JSON Response
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1705123456,
  "model": "v2-reasoning",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm Vigthoria AI. How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 15,
    "total_tokens": 27
  }
}

Key fields:

5

Available Models

Use different models for different tasks:

v2-reasoning Complex analysis, logic, planning
v2-creative Writing, brainstorming, content
v2-code Code generation, debugging
v2-vision Image analysis (multimodal)
Pro Tip

Use v2-code for programming tasks — it's faster and more accurate for code than the reasoning model.

🎯

Next Steps