Skip to content

Quickstart

Requests using X-Serve require a NETPREME_API_KEY. Follow the steps below to complete an inference request using the key.

API Key Creation

  1. Register an account at api.netpreme.com.
  2. Create a key under API Keys. Save the key.
  3. Add credits from the control in the Console header.

Inference Request

from openai import OpenAI

client = OpenAI(
    base_url="https://api.netpreme.com/v1",
    api_key=NETPREME_API_KEY,
)

response = client.chat.completions.create(
    model="moonshotai/Kimi-K3",
    messages=[{"role": "user", "content": "In one sentence, what can you help me with?"}],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.netpreme.com/v1",
  apiKey: "NETPREME_API_KEY",
});

const response = await client.chat.completions.create({
  model: "moonshotai/Kimi-K3",
  messages: [{ role: "user", content: "In one sentence, what can you help me with?" }]
});

console.log(response.choices[0].message.content);

Run this as an ES module. Set "type": "module" in your package.json, or wrap the call in an async function.

curl https://api.netpreme.com/v1/chat/completions \
  -H "Authorization: Bearer $NETPREME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonshotai/Kimi-K3",
    "messages": [{"role": "user", "content": "In one sentence, what can you help me with?"}]
  }'

Available models are shown in the model catalog. Coding agent integration is shown in Harness Integration. API Documentation are shown here.