OpenAI Compatible

Vivian API Reference

Drop-in replacement for the OpenAI API. Point any OpenAI SDK here.

🚀 Quick Start

Base URL: https://vivian.d0a.net/api
Authentication: Bearer token (your Vivian API key)
Get a key: sso.d0a.net

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://vivian.d0a.net/api/v1",
    api_key="sk-vivian-YOUR_KEY_HERE",
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

cURL

curl https://vivian.d0a.net/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-vivian-YOUR_KEY_HERE" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://vivian.d0a.net/api/v1",
  apiKey: "sk-vivian-YOUR_KEY_HERE",
});

const completion = await client.chat.completions.create({
  model: "gpt-4",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);

💬 Chat Completions

POST /v1/chat/completions Create a chat completion

Supports streaming (stream: true), function calling, vision, and all standard OpenAI parameters.

Streaming Example

stream = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

🧠 Models

GET /v1/models List available models
GET /v1/models/{model_id} Retrieve a specific model

📝 Completions (Legacy)

POST /v1/completions Create a text completion (legacy endpoint)

🔢 Embeddings

POST /v1/embeddings Create an embedding vector

🖼 Images

POST /v1/images/generations Generate images from a prompt

🎵 Audio

POST /v1/audio/transcriptions Transcribe audio to text
POST /v1/audio/translations Translate audio to English text

📁 Files

GET /v1/files List uploaded files
POST /v1/files Upload a file
GET /v1/files/{file_id} Retrieve file metadata
DELETE /v1/files/{file_id} Delete a file
GET /v1/files/{file_id}/content Download file content

🤖 Assistants

POST /v1/assistants Create an assistant
GET /v1/assistants List assistants
POST /v1/threads Create a thread
POST /v1/threads/{thread_id}/messages Add a message to a thread
POST /v1/threads/{thread_id}/runs Run an assistant on a thread

🗂 Vector Stores

POST /v1/vector_stores Create a vector store
GET /v1/vector_stores List vector stores

📦 Batches

POST /v1/batches Create a batch job
GET /v1/batches List batch jobs

🔧 Fine Tuning

POST /v1/fine_tuning/jobs Create a fine-tuning job
GET /v1/fine_tuning/jobs List fine-tuning jobs

🛡 Moderation

POST /v1/moderations Check if content violates policy

🔐 Authentication

All API requests require a Bearer token in the Authorization header. Get your API key from the Account Portal.

Authorization: Bearer sk-vivian-YOUR_KEY_HERE

OpenAI SDK

from openai import OpenAI
client = OpenAI(
    base_url="https://vivian.d0a.net/api/v1",
    api_key="sk-vivian-YOUR_KEY_HERE",
)