Get your API key and make your first programmatic request to Vigthoria in under 10 minutes.
Never share your API key or commit it to version control. Use environment variables to store it securely.
Store your API key as an environment variable:
# Add to your .bashrc, .zshrc, or .env file export VIGTHORIA_API_KEY="vg-live-sk-your-key-here"
# Set environment variable $env:VIGTHORIA_API_KEY = "vg-live-sk-your-key-here"
The Vigthoria API follows REST conventions. Here's the base URL:
Let's make a simple chat completion request:
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!"} ] }'
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())
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);
A successful response looks like this:
{
"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:
choices[0].message.content — The AI's response textusage — Token counts for billing/trackingfinish_reason — Why the response ended ("stop", "length", etc.)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) |
Use v2-code for programming tasks — it's faster and more accurate for code than the reasoning model.