Getting Started with API
novastack provides a fully OpenAI-compatible REST API, making it easy to integrate into your existing applications.
API Basic Information
| Item | Value |
|---|---|
| Base URL | https://api.novapai.ai/router/v1 |
| Current Version | v1 |
| Authentication | Bearer Token (API Key) |
| Content Type | application/json |
Quick Start - cURL
LLM Call Example
curl/chat-completions.sh
curl "$API_BASE_URL/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "nova-7b",
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself"
}
],
"temperature": 0.7,
"max_tokens": 512
}'Quick Start - Python
Install OpenAI SDK
requirements.txt
pip install openaiLLM Call Example
examples/chat_completion.py
import os
from openai import OpenAI
# Initialize client
client = OpenAI(
api_key="YOUR_API_KEY",
base_url=os.environ["API_BASE_URL"]
)
# Create chat completion
response = client.chat.completions.create(
model="nova-7b",
messages=[
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "Help me write a quicksort algorithm"
}
],
temperature=0.7,
max_tokens=1024
)
print(response.choices[0].message.content)Response Format Examples
LLM Response
responses/chat-completion.json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "nova-7b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I am a large language model developed by this platform..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 30,
"total_tokens": 45
}
}Next Steps
- API Authentication — Security best practices
- OpenAI — OpenAI-compatible endpoints on the router
- OpenAI Chat Completions — Endpoint reference for
POST /chat/completions - OpenAI Responses — Endpoint reference for
POST /responses