Tài Liệu Tích Hợp API

Tương thích 100% chuẩn OpenAI SDK và Anthropic SDK. Một base URL thống nhất cho toàn bộ hệ thống model.

Lấy API Key của bạn →

Base URL Hệ Thống

Sử dụng URL này cho mọi thư viện OpenAI, LangChain, LlamaIndex, Cursor IDE.

HTTP/2 Sẵn sàng
https://nurxeris.com/v1
Tool Windows (.EXE) Miễn Phí ⚡ 1-Click Auto Setup

Nurxeris Auto Configurator Tool (.exe)

Không cần cấu hình file thủ công! Tải tool exe siêu nhẹ (27KB, chạy ngay, không cần cài đặt). Bạn chỉ cần nhập API Key và chọn model mong muốn, ấn 1 nút là tool tự động phát hiện đường dẫn và ghi đè cấu hình vào Cursor IDE, Antigravity IDE (Google AGY), Claude Code CLI & Claude Desktop, OpenCode Interpreter, VS Code (Cline & Roo Code), Continue.dev, Windsurf, Aider CLI, Codex và thiết lập biến môi trường Windows.

1. Tích Hợp IDE & Coding Agents (Cursor, Antigravity, Claude, OpenCode)

Lập trình AI không giới hạn với chi phí tiết kiệm tới 80% so với đăng ký Pro.

IDEs & CLI

A. Cursor IDE:

01 Open the model settings
Press Ctrl+Shift+J (Cmd+J on Mac) to open Cursor Settings and choose Models.
[Cursor] Shortcut: Ctrl+Shift+J

02 Add the model
In the Models search box, type the model id exactly as shown and click Add Custom Model.
[Model] e.g. deepseek-v4.1-flash-1017 (hoặc deepseek-r1, qwen-3.8-max)

03 Open API Keys
Scroll down to the API Keys section on the same page.
[Cursor] Cursor Settings → Models → API Keys

04 Turn on OpenAI API Key
Cursor routes every custom endpoint through its OpenAI fields, including DeepSeek, Qwen, GLM and Grok models. Leave the Anthropic and Google fields empty.
[Cursor]
OpenAI API Key: on
Anthropic API Key: off
Google API Key: off

05 Paste your Nurxeris key
It goes in the OpenAI API Key field.
[Key] sk-nurxeris-xxxxxxxxx (lấy tại /app/keys)

06 Override the base URL
Turn on Override OpenAI Base URL, paste the URL and click Verify.
[Base URL] https://nurxeris.com/v1

07 Pick the model
In the chat model dropdown, turn off Auto and select your model. Chat, Agent and Cmd+K now run on Nurxeris. Tab completion keeps using Cursor's own models.
[Cursor] deepseek-v4.1-flash-1017

B. Antigravity IDE & AGY CLI (Google DeepMind):

# Cách 1: Thiết lập cấu hình JSON tại ~/.gemini/antigravity/config.json
{
  "api_base": "https://nurxeris.com/v1",
  "api_key": "sk-nurxeris-xxxxxxxxx",
  "model": "claude-3-7-sonnet"
}

# Cách 2: Thiết lập Biến Môi Trường (PowerShell / Windows / Linux)
export ANTIGRAVITY_BASE_URL="https://nurxeris.com/v1"
export ANTIGRAVITY_API_KEY="sk-nurxeris-xxxxxxxxx"

# Hoặc tải công cụ NurxerisConfigurator.exe bên dưới để tự động ghi đè 1-click!

C. Claude Code CLI & Claude Desktop:

# Thiết lập Terminal để chạy Claude Code CLI trực tiếp qua Nurxeris Gateway:
export ANTHROPIC_BASE_URL="https://nurxeris.com/v1"
export ANTHROPIC_API_KEY="sk-nurxeris-xxxxxxxxx"

# Chạy Claude Code:
claude --model claude-3-7-sonnet

D. OpenCode Interpreter / CLI:

# Cấu hình OpenCode Interpreter (~/.opencode/config.json hoặc .env):
{
  "api_base": "https://nurxeris.com/v1",
  "api_key": "sk-nurxeris-xxxxxxxxx",
  "model": "deepseek-r1"
}

# Chạy terminal:
opencode run "Viết API server Node.js với Express"

E. Codex / Biến Môi Trường Hệ Thống:

# Cấu hình Biến môi trường hệ thống cho Codex & OpenAI CLI:
export OPENAI_BASE_URL="https://nurxeris.com/v1"
export OPENAI_API_BASE="https://nurxeris.com/v1"
export OPENAI_API_KEY="sk-nurxeris-xxxxxxxxx"
export NURXERIS_API_KEY="sk-nurxeris-xxxxxxxxx"

F. Cline & Roo Code (VS Code Extension):

1. Mở extension Cline hoặc Roo Code trong VS Code
2. Vào Settings (biểu tượng bánh răng) -> Chọn Provider: "OpenAI Compatible"
3. Điền Base URL: https://nurxeris.com/v1
4. Điền API Key: sk-nurxeris-xxxxxxxxx
5. Model ID: claude-3-7-sonnet (hoặc deepseek-r1, gpt-4o)

2. Cổng Đầu Vào Hình Ảnh (Multimodal Vision)

Truyền hình ảnh qua image_url hỗ trợ cả URL công khai và Base64 data URI.

Vision Multimodal

Áp dụng cho các model Vision như gpt-4o, claude-3-7-sonnet, gemini-2.5-flash, qwen-vl:

Ví dụ cURL với Image URL:

curl https://nurxeris.com/v1/chat/completions \
  -H "Authorization: Bearer $NURXERIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "Phân tích cấu trúc giao diện và trích xuất text trong ảnh này:"},
          {"type": "image_url", "image_url": {"url": "https://images.unsplash.com/photo-1551288049-bebda4e38f71"}}
        ]
      }
    ]
  }'

Ví dụ Python với Base64 & Local File:

from openai import OpenAI

client = OpenAI(apiKey="sk-nurxeris-xxxxxxxxx", base_url="https://nurxeris.com/v1")

# 1. Gửi ảnh qua link công khai (URL)
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Mô tả nội dung hình ảnh:"},
            {"type": "image_url", "image_url": {"url": "https://example.com/chart.png"}}
        ]
    }]
)
print(response.choices[0].message.content)

# 2. Gửi ảnh trực tiếp từ file (Base64 data URI)
import base64
with open("invoice.png", "rb") as f:
    b64 = base64.b64encode(f.read()).decode("utf-8")

res_b64 = client.chat.completions.create(
    model="claude-3-7-sonnet",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Đọc bảng số liệu trong hoá đơn:"},
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}}
        ]
    }]
)
print(res_b64.choices[0].message.content)

3. Cổng Sinh Ảnh (Image Generations API)

Endpoint POST /v1/images/generations chuẩn OpenAI.

POST

Sinh ảnh độ phân giải cao với DALL-E 3, Flux 1 Schnell và Midjourney:

curl https://nurxeris.com/v1/images/generations \
  -H "Authorization: Bearer $NURXERIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "Futuristic Vietnamese city with neon cyber lanterns and flying vehicles, cinematic 8k",
    "n": 1,
    "size": "1024x1024"
  }'

4. Chat Completions & Streaming SSE

Endpoint POST /v1/chat/completions

OpenAI Format
curl https://nurxeris.com/v1/chat/completions \
  -H "Authorization: Bearer $NURXERIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-r1","messages":[{"role":"user","content":"Xin chào"}]}'

Streaming từng token theo thời gian thực (Node.js SDK):

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.NURXERIS_API_KEY,
  baseURL: "https://nurxeris.com/v1",
});

const res = await client.chat.completions.create({
  model: "claude-3-7-sonnet",
  messages: [{ role: "user", content: "Xin chào Nurxeris API" }],
  stream: true,
});

for await (const chunk of res) {
  process.stdout.write(chunk.choices[0]?.delta?.content || "");
}

5. Function Calling & Tool Discipline

Hỗ trợ đầy đủ tham số tools và tool_choice.

Tools
import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.NURXERIS_API_KEY, baseURL: "https://nurxeris.com/v1" });

const res = await client.chat.completions.create({
  model: "claude-3-7-sonnet",
  messages: [{ role: "user", content: "Kiểm tra giá vàng hôm nay tại Hà Nội" }],
  tools: [{
    type: "function",
    function: {
      name: "get_gold_price",
      description: "Tra cứu giá vàng hiện tại theo thành phố",
      parameters: {
        type: "object",
        properties: { city: { type: "string" } },
        required: ["city"]
      }
    }
  }],
  tool_choice: "auto"
});
console.log(res.choices[0].message.tool_calls);

6. Anthropic Messages (Claude SDK Native)

Endpoint POST /v1/messages

Anthropic Format
curl https://nurxeris.com/v1/messages \
  -H "x-api-key: $NURXERIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-3-7-sonnet","max_tokens":1024,"messages":[{"role":"user","content":"Xin chào"}]}'

Danh Sách Toàn Bộ Endpoints

Method & PathChức năngQuyền hạn
GET /v1/modelsDanh sách 144+ model đang mở kèm bảng giá niêm yếtPublic / Bearer Key
GET /v1/key/infoKiểm tra thông tin key, quota RPM/TPM và số dư creditBearer Key
GET /v1/usageThống kê lượng token và số tiền đã sử dụng trong 30 ngàyBearer Key
POST /v1/chat/completionsChat, Vision Multimodal, Function Calling, Streaming SSEBearer Key
POST /v1/images/generationsCổng sinh ảnh chuẩn OpenAI (DALL-E 3, Flux, Midjourney)Bearer Key
POST /v1/embeddingsVector hóa văn bản phục vụ RAG và Semantic SearchBearer Key
POST /v1/messagesCổng chat tương thích SDK Anthropic chính thứcx-api-key
POST /api/payos/webhookWebhook nhận tín hiệu thanh toán tự động PayOS VietQRPayOS Checksum

Bảng Mã Lỗi & Cách Xử Lý

Mã HTTPLoại lỗi (type)Nguyên nhân & Cách xử lý
400invalid_request_errorBody JSON không hợp lệ hoặc thiếu trường bắt buộc (ví dụ thiếu prompt khi sinh ảnh).
401authentication_errorAPI Key không đúng, đã bị thu hồi hoặc tài khoản đang bị khoá.
402insufficient_creditTài khoản hết credit. Vui lòng nạp thêm tại /app/topup để tiếp tục.
403model_not_allowedKey của bạn bị giới hạn allowlist không được gọi model này.
404model_not_foundTên model không tồn tại hoặc đã tạm đóng bảo trì.
429rate_limit_errorVượt quá giới hạn RPM (Request/Phút) hoặc hạn mức chi tiêu Token/Ngày.
502upstream_errorLỗi nhà cung cấp sau khi engine đã tự động thử failover qua các provider dự phòng.
503upstream_errorChưa cấu hình hoặc toàn bộ upstream provider đang tạm ngưng kết nối.

💬 Cần Hỗ Trợ Tích Hợp Kỹ Thuật?

Kỹ thuật viên NUXERIS trực 24/7 để hỗ trợ bạn cấu hình Cursor, Cline, OpenCode, SDK Python/Node.js hoặc nạp credit.

CHUYÊN TRANG KỸ THUẬT & HƯỚNG DẪN AI

Kiến Thức & Hướng Dẫn Tối Ưu Mới Nhất

Cập nhật phân tích kỹ thuật, tối ưu chi phí token và kỹ thuật reverse engineering.

Xem tất cả bài viết
Hỗ trợ 24/7