HUY MMO
Quy chuẩn API · Tương thích 100% chuẩn OpenAI

Tài liệu Kỹ thuật & Tích hợp

Tích hợp HUY MMO vào dự án của bạn chỉ trong 60 giây bằng cách đổi Base URL và API Key.

Đường dẫn API Base URL https://giahuynexus.com/v1
Header Xác thực Bearer sk-gw-... / x-api-key
Giao thức Hỗ trợ OpenAI Chat, Anthropic Claude, Embeddings
PYTHON SDK

1. Tích hợp Python (`openai`)

Cài đặt thư viện: pip install openai

main.py
from openai import OpenAI

# Initialize client pointing to Gateway
client = OpenAI(
    base_url="https://giahuynexus.com/v1",
    api_key="sk-gw-your-api-key" # Retrieve from Dashboard
)

response = client.chat.completions.create(
    model="claude-3-7-sonnet", # Or gpt-4o, deepseek-chat, gemini-2.0-flash
    messages=[
        {"role": "system", "content": "You are an expert programming assistant."},
        {"role": "user", "content": "Write an optimized prime checking function in Python."}
    ],
    stream=True
)

for chunk in response:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)
TYPESCRIPT / NODE.JS

2. Tích hợp Node.js / TypeScript

Cài đặt thư viện: npm install openai

index.ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://giahuynexus.com/v1",
  apiKey: "sk-gw-your-api-key",
});

async function main() {
  const stream = await client.chat.completions.create({
    model: "gpt-4o",
    messages: [{ role: "user", content: "Analyze the pros and cons of microservices architecture." }],
    stream: true,
  });

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

main();
DEV TOOLS

3. Kết nối với Cursor IDE, Claude Code, Cline

Trong cài đặt IDE hoặc extension (Settings → Models / OpenAI API):

  • Base URL: https://giahuynexus.com/v1
  • API Key: Dán mã API Key được tạo trong Bảng điều khiển.
  • Tên mô hình: Chỉ định mô hình bạn muốn dùng như claude-3-7-sonnet, gpt-4o, deepseek-chat.
ANTHROPIC NATIVE

4. Claude Code CLI & Anthropic SDK

Sử dụng công cụ CLI claude chính hãng trực tiếp bằng cách gán 2 biến môi trường:

Terminal / Bash / Zsh
export ANTHROPIC_BASE_URL="https://giahuynexus.com/v1"
export ANTHROPIC_API_KEY="sk-gw-your-api-key"

# Launch Claude Code CLI
claude
EMBEDDINGS & RAG

5. Tạo Vector Embeddings (/v1/embeddings)

Tạo embeddings cho LangChain, LlamaIndex hoặc Vector Database (Chroma, Pinecone, Qdrant):

curl command
curl https://giahuynexus.com/v1/embeddings \
  -H "Authorization: Bearer sk-gw-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Machine learning and artificial intelligence are revolutionizing modern software engineering."
  }'