Skip to main content

Developer Center

Send your first model request in minutes

Use the SDK you already know by replacing only the API endpoint and key. Available APIs and models follow the console configuration.

1Create key2Set endpoint3Send request
quickstart.py
client = OpenAI(  base_url="/v1",  api_key="YOUR_KEY")

Developer Center

Cover every critical step from integration to reliable operations

Nov Apis Bring complex model integration, routing, governance, and usage management into one clear workflow.

01

Create an API key

Sign in to create a key and configure its group, quota, concurrency, and expiration as needed.

Explore further
02

Set the Base URL

Change the SDK service endpoint to this API while keeping your existing request structure.

03

Review usage

Review request status, tokens, charges, and upstream errors in usage history.

Explore further

Quick Start

Send your first request in minutes.

Create a key, set the Base URL, then keep using the SDK and message format you already know.

  1. Create an API key in the console
  2. Copy this service's API endpoint
  3. Choose a model and send a request
request.sh
curl https://www.novapis.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

SDK support

Integrate for your platform

Compatible SDK and HTTP integration examples, not engine plugins published by this site.

Keep API keys on the server. Clients call an authenticated application backend.

/api/ai/chat is your own application route. Integrate the Node.js example below with session authentication, rate limits and CORS policies.

Set OPENAI_BASE_URL to your gateway URL plus /v1, and OPENAI_MODEL to a model available in the console.

Game development SDKs

Unreal Engine 5C++ · HTTP / JsonIntegration example
// YourProject.Build.cs
PrivateDependencyModuleNames.AddRange(new string[] { "HTTP", "Json" });
AIRequest.cpp
#include "CoreMinimal.h"
#include "HttpModule.h"
#include "Interfaces/IHttpRequest.h"
#include "Interfaces/IHttpResponse.h"
#include "Dom/JsonObject.h"
#include "Serialization/JsonSerializer.h"
#include "Serialization/JsonWriter.h"

// Call your own authenticated backend, not the model gateway.
// SessionToken is a short-lived user session, NOT an API key.
void SendAIRequest(const FString& BackendOrigin,
    const FString& SessionToken, const FString& Prompt)
{
    auto Body = MakeShared<FJsonObject>();
    Body->SetStringField(TEXT("prompt"), Prompt);
    FString Payload;
    auto Writer = TJsonWriterFactory<>::Create(&Payload);
    FJsonSerializer::Serialize(Body, Writer);

    auto Request = FHttpModule::Get().CreateRequest();
    Request->SetURL(BackendOrigin + TEXT("/api/ai/chat"));
    Request->SetVerb(TEXT("POST"));
    Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
    Request->SetHeader(TEXT("Authorization"), TEXT("Bearer ") + SessionToken);
    Request->SetContentAsString(Payload);
    Request->SetTimeout(30.0f);
    Request->OnProcessRequestComplete().BindLambda(
        [](FHttpRequestPtr, FHttpResponsePtr Response, bool bSuccess) {
            if (!bSuccess || !Response.IsValid() ||
                Response->GetResponseCode() != 200) {
                UE_LOG(LogTemp, Warning, TEXT("AI request failed"));
                return;
            }
            // Response JSON: {"text":"..."}. Parse before updating UI.
            UE_LOG(LogTemp, Log, TEXT("%s"), *Response->GetContentAsString());
        });
    if (!Request->ProcessRequest()) {
        UE_LOG(LogTemp, Warning, TEXT("AI request could not start"));
    }
}
UnityC# · UnityWebRequestIntegration example
// Unity 2022.3+ / Unity 6
// StartCoroutine(Chat(backendOrigin, userSessionToken, "Hello"));
AIClient.cs
using System;
using System.Collections;
using System.Text;
using UnityEngine;
using UnityEngine.Networking;

public class AIClient : MonoBehaviour
{
    [Serializable] class ChatRequest { public string prompt; }
    [Serializable] class ChatResponse { public string text; }

    // Use a user session token, never embed the gateway API key.
    public IEnumerator Chat(string backendOrigin, string sessionToken, string prompt)
    {
        var json = JsonUtility.ToJson(new ChatRequest { prompt = prompt });
        using var request = new UnityWebRequest(
            backendOrigin.TrimEnd('/') + "/api/ai/chat", "POST");
        request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(json));
        request.downloadHandler = new DownloadHandlerBuffer();
        request.SetRequestHeader("Content-Type", "application/json");
        request.SetRequestHeader("Authorization", "Bearer " + sessionToken);
        request.timeout = 30;
        yield return request.SendWebRequest();
        if (request.result != UnityWebRequest.Result.Success) {
            Debug.LogWarning($"AI request failed: {request.responseCode}");
            yield break;
        }
        var reply = JsonUtility.FromJson<ChatResponse>(request.downloadHandler.text);
        Debug.Log(reply.text);
    }
}
Cocos CreatorTypeScript · XMLHttpRequestIntegration example
// Cocos Creator 3.8
// await chat(backendOrigin, userSessionToken, "Hello");
AIClient.ts
// Call the authenticated business backend with a user session.
export function chat(origin: string, session: string, prompt: string): Promise<string> {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest();
    xhr.open('POST', origin.replace(/\/+$/, '') + '/api/ai/chat');
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.setRequestHeader('Authorization', 'Bearer ' + session);
    xhr.timeout = 30000;
    xhr.onerror = () => reject(new Error('Network error'));
    xhr.ontimeout = () => reject(new Error('Request timed out'));
    xhr.onabort = () => reject(new Error('Request cancelled'));
    xhr.onload = () => {
      if (xhr.status !== 200) {
        reject(new Error('HTTP ' + xhr.status));
        return;
      }
      try {
        const data = JSON.parse(xhr.responseText);
        if (typeof data.text !== 'string') throw new Error('Invalid response');
        resolve(data.text);
      } catch (error) { reject(error); }
    };
    xhr.send(JSON.stringify({ prompt }));
  });
}

Software development SDKs

PythonPython 3.10+ · OpenAI SDKIntegration example
pip install openai
# Server environment: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
# OPENAI_BASE_URL = your gateway origin + /v1
example.py
import os
from openai import OpenAI, APIError

# Run on a trusted server. Do not distribute credentials with an app.
with OpenAI(
    api_key=os.environ['OPENAI_API_KEY'],
    base_url=os.environ['OPENAI_BASE_URL'],
    timeout=30.0,
) as client:
    try:
        result = client.chat.completions.create(
            model=os.environ['OPENAI_MODEL'],
            messages=[{'role': 'user', 'content': 'Hello'}],
        )
        print(result.choices[0].message.content)
    except APIError as error:
        print(f'Request failed: {type(error).__name__}')
.NET / C#.NET 8+ · HttpClientIntegration example
dotnet new console -n GatewayDemo
# Server environment: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
Program.cs
using System.Net.Http.Headers;
using System.Net.Http.Json;

static string Required(string key) =>
    Environment.GetEnvironmentVariable(key)
    ?? throw new InvalidOperationException($"Missing {key}");

// Trusted server example; use your business backend for desktop apps.
using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Required("OPENAI_API_KEY"));
var endpoint = Required("OPENAI_BASE_URL").TrimEnd('/') + "/chat/completions";
using var response = await client.PostAsJsonAsync(endpoint, new {
    model = Required("OPENAI_MODEL"),
    messages = new[] { new { role = "user", content = "Hello" } }
});
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
GoGo · net/httpIntegration example
go mod init gateway-demo
# Server environment: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
main.go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "log"
    "net/http"
    "os"
    "strings"
    "time"
)

func main() {
    key, base, model := os.Getenv("OPENAI_API_KEY"), os.Getenv("OPENAI_BASE_URL"), os.Getenv("OPENAI_MODEL")
    if key == "" || base == "" || model == "" { log.Fatal("Missing server environment") }
    body, err := json.Marshal(map[string]any{
        "model": model,
        "messages": []map[string]string{{"role": "user", "content": "Hello"}},
    })
    if err != nil { log.Fatal(err) }
    req, err := http.NewRequest(http.MethodPost, strings.TrimRight(base, "/")+"/chat/completions", bytes.NewReader(body))
    if err != nil { log.Fatal(err) }
    req.Header.Set("Authorization", "Bearer "+key)
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{Timeout: 30 * time.Second}
    resp, err := client.Do(req)
    if err != nil { log.Fatal(err) }
    defer resp.Body.Close()
    if resp.StatusCode != http.StatusOK { log.Fatalf("HTTP %d", resp.StatusCode) }
    data, err := io.ReadAll(io.LimitReader(resp.Body, 4<<20))
    if err != nil { log.Fatal(err) }
    fmt.Println(string(data))
}

Web development SDKs

Node.js / ExpressNode.js 22+ · OpenAI SDKIntegration example
npm install openai express
# Server environment: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
# Integrate with an existing app and its requireUserSession middleware.
ai-route.mjs
import express from 'express';
import OpenAI from 'openai';
// Project integration: implement session validation before using this route.
// Reject unauthenticated requests; enforce per-user quotas and rate limits.
// For browser cookies, also enforce CSRF/origin checks.
import { requireUserSession } from './middleware/session.mjs';

for (const key of ['OPENAI_API_KEY', 'OPENAI_BASE_URL', 'OPENAI_MODEL']) {
  if (!process.env[key]) throw new Error(`Missing ${key}`);
}
const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: process.env.OPENAI_BASE_URL,
  timeout: 25000,
  maxRetries: 0,
});
export const aiRouter = express.Router();
// Mount with app.use(aiRouter). This is YOUR route, not a gateway endpoint.
aiRouter.post('/api/ai/chat', requireUserSession, express.json({ limit: '16kb' }), async (req, res) => {
  const prompt = req.body?.prompt;
  if (typeof prompt !== 'string' || !prompt.trim() || prompt.length > 4000) {
    return res.status(400).json({ error: 'Invalid prompt' });
  }
  try {
    const result = await client.chat.completions.create({
      model: process.env.OPENAI_MODEL,
      messages: [{ role: 'user', content: prompt }],
      max_tokens: 512,
    });
    res.set('Cache-Control', 'no-store');
    return res.json({ text: result.choices[0]?.message?.content ?? '' });
  } catch {
    return res.status(502).json({ error: 'AI service unavailable' });
  }
});
React / Vue / JavaScriptBrowser · Fetch APIIntegration example
// Use in your React event handler or Vue action.
// Requires the /api/ai/chat business route shown above.
// Same-origin authenticated session cookie + server-side CSRF validation.
chat.ts
// Never expose OPENAI_API_KEY via VITE_* or NEXT_PUBLIC_* variables.
export async function chat(prompt: string, csrfToken: string): Promise<string> {
  const controller = new AbortController();
  const timeout = setTimeout(() => controller.abort(), 30000);
  try {
    const response = await fetch('/api/ai/chat', {
      method: 'POST',
      credentials: 'same-origin',
      headers: {
        'Content-Type': 'application/json',
        'X-CSRF-Token': csrfToken,
      },
      body: JSON.stringify({ prompt }),
      signal: controller.signal,
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}`);
    const data = await response.json();
    if (typeof data.text !== 'string') throw new Error('Invalid response');
    return data.text;
  } finally {
    clearTimeout(timeout);
  }
}

Ready to build the future of AI?

Join developers using Nov Apis to build products, starting with your first API request.