NovaPAI Go SDK Example π΅
Use NovaPAI in Go β OpenAI-compatible API gateway for DeepSeek V4 Pro & 50+ LLMs. Change one line of code, switch to any model.

What is NovaPAI?
NovaPAI is an OpenAI-compatible API gateway that gives you access to top-tier LLMs like DeepSeek V4 Pro, GPT-4, Claude, Gemini (50+ models) through the standard OpenAI SDK. If you know how to use the OpenAI API, you already know how to use NovaPAI β just change the base_url.
Quick Start
1. Get an API Key
Sign up at novapai.ai to get your free API key.
2. Install the SDK
go get github.com/sashabaranov/go-openai
3. Run the Example
git clone https://github.com/NovaStackAI/novapai-go.git
cd novapai-go
export NOVAPAI_API_KEY="your-api-key"
go run main.go
Examples Included
All examples are in main.go:
| # |
Example |
Description |
| 1 |
Basic Chat |
Single-turn chat completion |
| 2 |
Streaming |
Real-time token-by-token output |
| 3 |
Multi-turn Conversation |
Context-aware multi-message dialogue |
| 4 |
Function Calling |
Define tools, let the model decide which to call |
| 5 |
JSON Mode |
Structured JSON output for data extraction |
| 6 |
List Models |
Fetch all available models |
Core Concept
# Standard OpenAI SDK β just change base_url!
from openai import OpenAI
client = OpenAI(
api_key="your-novapai-key",
base_url="https://api.novapai.ai/router/v1" # β Only this line changes!
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
That's it. The OpenAI SDK you already know works directly with NovaPAI. No new SDK to learn, no new API surface.
Why NovaPAI?
- β
OpenAI-Compatible β Use any OpenAI SDK in any language
- β
50+ Models β DeepSeek V4 Pro, GPT-4, Claude, Gemini and more
- β
One API Key β All models, one account
- β
No Vendor Lock-in β Switch models with one line change
- β
Free Tier Available β Start building with free credits
All SDK Examples
Browse all our SDK examples:
Links
Made with β€οΈ by NovaStackAI