API Documentation

Hướng dẫn sử dụng API

Chọn loại key → 3 bước → chạy.

OpenAI · Anthropic compatible api.nghimmo.com

Bạn mua key nào?

Kết nối

Base URLhttps://api.nghimmo.com
Keysk-xxxxxxxxxxxx
Không có /v1. Riêng Cursor Pro thì thêm /v1.

Model

Mạnh nhất, cho việc khó. Mới nhất: nghi/claude-opus-5.

nghi/claude-opus-5
nghi/claude-opus-5-thinking
nghi/claude-opus-4.8
nghi/claude-opus-4.8-thinking
nghi/claude-opus-4.7
nghi/claude-opus-4.7-thinking
nghi/claude-opus-4.6
nghi/claude-opus-4.6-thinking
nghi/claude-opus-4.5
nghi/claude-opus-4.5-thinking

Dùng hằng ngày. Mặc định: nghi/claude-sonnet-5.

nghi/claude-sonnet-5
nghi/claude-sonnet-4.6
nghi/claude-sonnet-4.6-thinking
nghi/claude-sonnet-4.5
nghi/claude-sonnet-4.5-thinking
nghi/claude-sonnet-4
nghi/claude-sonnet-4-thinking

Việc nhẹ, rẻ token.

nghi/claude-haiku-4.5
nghi/claude-haiku-4.5-thinking

Server tự chọn model.

nghi/auto

Cài đặt

  1. Cài Claude Desktop: claude.com/download — không dùng Microsoft Store.
  2. Tải tool, dán key → Áp dụng:

    macOS Windows Linux

  3. Mở lại app → Continue with Gateway.

Máy chặn khi mở tool: macOS chuột phải → Open · Windows → More info → Run anyway. Linux: dùng tab Linux (Claude Desktop ít hỗ trợ Linux).

Đổi key: dán key mới → Áp dụng. Gỡ: Reset.
Mac — tool báo OK nhưng không thấy Gateway
  1. Cài Claude từ .dmg tại claude.com/download — không App Store.
  2. Cmd+Q thoát hẳn Claude trước khi chạy tool.
  3. Nếu double-click không chạy, mở Terminal:
cd ~/Downloads
xattr -d com.apple.quarantine ClaudeKeyTool.command 2>/dev/null
chmod +x ClaudeKeyTool.command
bash ClaudeKeyTool.command

Kiểm tra config đã ghi:

ls ~/Library/Application\ Support/Claude-3p/configLibrary/
cat ~/Library/Application\ Support/Claude-3p/configLibrary/_meta.json

Mở Claude → chọn Continue with Gateway (không đăng nhập claude.ai). Log tool: ~/Library/Logs/claude-key-tool.log

  1. npm install -g @anthropic-ai/claude-code
  2. Chạy ClaudeKeyTool (tool chung — cấu hình luôn Claude Code):

    macOS Windows Linux

Cấu hình tay

Sửa ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.nghimmo.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "nghi/claude-sonnet-5[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "nghi/claude-opus-5[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "nghi/claude-sonnet-5[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "nghi/claude-haiku-4.5[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "nghi/claude-haiku-4.5[1m]",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
    "CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK": "1",
    "API_TIMEOUT_MS": "600000"
  }
}
ANTHROPIC_API_KEY để trống — chỉ dùng ANTHROPIC_AUTH_TOKEN. Timeout 10 phút (API_TIMEOUT_MS=600000) để không cắt khi model nghĩ lâu. GATEWAY_MODEL_DISCOVERY lấy list model từ gateway. DISABLE_REFUSAL_FALLBACK không nhảy về Anthropic.com.
Claude Code CLI không đọc context từ server — mặc định hiện /200k. Bắt buộc hậu tố [1m] trong tên model (vd nghi/claude-opus-5[1m]) hoặc gõ /model nghi/claude-opus-5[1m] rồi restart CLI. Server đã sẵn sàng 1M.
Trên Linux ưu tiên Claude Code CLI hoặc extension trong VS Code / Cursor. Claude Desktop chính thức thường không có bản Linux.
  1. Cài Node.js 18+ rồi:
    npm install -g @anthropic-ai/claude-code
  2. Tải script Linux → chạy trong Terminal:

    Linux (.sh)

    chmod +x ClaudeKeyTool.sh
    ./ClaudeKeyTool.sh sk-xxxxxxxxxxxx
  3. Chạy claude. Nếu cần đổi model: /model nghi/claude-sonnet-5[1m]

VS Code / Cursor / Codium trên Linux: cài extension Claude Code → chạy cùng script ở trên → Ctrl+Shift+P → Reload Window.

Cấu hình tay (không dùng script)

Sửa ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.nghimmo.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "nghi/claude-sonnet-5[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "nghi/claude-opus-5[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "nghi/claude-sonnet-5[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "nghi/claude-haiku-4.5[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "nghi/claude-haiku-4.5[1m]",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
    "CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK": "1",
    "API_TIMEOUT_MS": "600000"
  }
}
Test nhanh bằng curl
curl https://api.nghimmo.com/v1/messages \
  -H "x-api-key: sk-xxxxxxxxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"nghi/claude-sonnet-5","max_tokens":64,"messages":[{"role":"user","content":"ping"}]}'
Gỡ cấu hình: ./ClaudeKeyTool.sh --reset
  1. Cài extension Claude Code (Anthropic) trong VS Code / Cursor / Antigravity.
  2. Chạy ClaudeKeyTool → dán key → Áp dụng:

    macOS Windows Linux

  3. Ctrl+Shift+PReload Window.
  1. Ctrl+Shift+JModels
  2. Bật Override OpenAI Base URLhttps://api.nghimmo.com/v1
  3. Dán key → Verify → thêm nghi/claude-sonnet-5
Tắt hết model mặc định của Cursor.
  1. Chatbox → Settings → Model Provider → Claude
  2. API Host https://api.nghimmo.com/v1 · Key sk-...
  3. Thêm nghi/claude-sonnet-5Test Model

Kết nối

Base URLhttps://api.nghimmo.com/v1
Keysk-xxxxxxxxxxxx
Luôn có /v1. Key Grok không chạy Claude Code.

Model

Không chọn gì thì mặc định nghi/grok-4.5.

ModelDùng khi
nghi/grok-4.5Mạnh nhất — code, agent
nghi/grok-4.3Context 1M, rẻ hơn
nghi/grok-4.20-0309-reasoningCó suy luận
nghi/grok-4.20-0309-non-reasoningNhanh, rẻ
nghi/grok-4.20-multi-agent-0309Nghiên cứu sâu
nghi/grok-build-0.1Code / agent
nghi/grok-composer-2.5-fastCode nhanh trong Cursor
nghi/grok-4.5-latest
nghi/grok-build-latest
Alias của grok-4.5
nghi/grok-3-mini
nghi/grok-3-mini-fast
Legacy
Chỉ 11 model này. Sai tên là lỗi ngay. Không có model ảnh/video.

Cài đặt

  1. Ctrl+Shift+JModels
  2. Bật Override OpenAI Base URLhttps://api.nghimmo.com/v1
  3. Dán key → Verify → thêm nghi/grok-4.5
Tắt hết model mặc định của Cursor.

Cline / Roo Code: Settings → API Provider OpenAI Compatible → điền:

Base URL : https://api.nghimmo.com/v1
API Key  : sk-xxxxxxxxxxxx
Model    : nghi/grok-4.5

Continue: sửa ~/.continue/config.yaml:

models:
  - name: Nghimmo Grok
    provider: openai
    model: nghi/grok-4.5
    apiBase: https://api.nghimmo.com/v1
    apiKey: sk-xxxxxxxxxxxx

LobeChat, NextChat, Open WebUI… — mọi app OpenAI compatible:

Base URL : https://api.nghimmo.com/v1
API Key  : sk-xxxxxxxxxxxx
Model    : nghi/grok-4.5
  1. Chatbox → Settings → Model Provider → OpenAI API Compatible
  2. API Host https://api.nghimmo.com/v1 · Key sk-...
  3. Thêm nghi/grok-4.5 → Test

Kết nối

Base URLhttps://api.nghimmo.com/v1
Keysk-xxxxxxxxxxxx
Luôn có /v1. Key Codex không chạy Claude Code.

Model

ModelDùng khi
nghi/gpt-5.5Mặc định — ổn định
nghi/gpt-5.6-solMạnh nhất, tốn token
nghi/gpt-5.6-terraCân bằng
nghi/gpt-5.6-lunaNhanh, rẻ
nghi/gpt-5.4Context lớn
nghi/gpt-5.4-miniViệc nhỏ, subagent
nghi/codex-auto-reviewReview code tự động
Key Codex không dùng được model Claude hay Grok.

Cài đặt

  1. Cài ChatGPT từ Microsoft Store (của OpenAI).
  2. Tải tool → Desktop → dán key → Đăng nhập:

    macOS Windows Linux

  3. Tắt hẳn ChatGPT, mở lại → dùng ChatGPT Work / Codex.
Gỡ: tool → Reset. Linux: dùng tab Linux (Codex CLI).
Microsoft Store — ChatGPT by OpenAI
Trên Linux dùng Codex CLI hoặc extension Codex trong VS Code. App ChatGPT Desktop thường không có bản Linux.
  1. Cài Codex CLI (theo hướng dẫn OpenAI / npm nếu bạn dùng bản CLI).
  2. Tải script → chạy:

    Linux (.sh)

    chmod +x CodexKeyTool.sh
    ./CodexKeyTool.sh sk-xxxxxxxxxxxx
    codex

Extension Codex (VS Code) trên Linux: cài extension → chạy script ở trên → tắt hẳn VS Code rồi mở lại.

Cấu hình tay (~/.codex)

~/.codex/auth.json:

{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "sk-xxxxxxxxxxxx"
}

~/.codex/config.toml (rút gọn):

model = "gpt-5.6-sol"
model_provider = "Nghimmo"
sandbox_mode = "danger-full-access"
approval_policy = "never"

[model_providers.Nghimmo]
name = "Nghimmo"
base_url = "https://api.nghimmo.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
Test nhanh bằng curl
curl https://api.nghimmo.com/v1/chat/completions \
  -H "Authorization: Bearer sk-xxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{"model":"nghi/gpt-5.5","messages":[{"role":"user","content":"ping"}]}'
Gỡ: ./CodexKeyTool.sh --reset
  1. Ctrl+Shift+JModels
  2. Bật Override OpenAI Base URLhttps://api.nghimmo.com/v1
  3. Dán key → Verify → thêm nghi/gpt-5.5
Tắt hết model mặc định của Cursor.

Extension Codex (OpenAI) trên VS Code:

  1. Cài extension Codex (OpenAI) trong VS Code.
  2. Tải tool → chọn CLI → dán key → Đăng nhập:

    Windows macOS Linux

  3. Tắt hẳn VS Code → mở lại → chat Codex mới.
Lỗi Update Agent sandbox trên Windows: mở %USERPROFILE%\.codex\config.toml, đảm bảo sandbox = "unelevated" trong [windows], rồi chạy lại tool hoặc sửa tay.

Cline / Roo Code: Settings → API Provider OpenAI Compatible → điền:

Base URL : https://api.nghimmo.com/v1
API Key  : sk-xxxxxxxxxxxx
Model    : nghi/gpt-5.5

Continue: sửa ~/.continue/config.yaml:

models:
  - name: Nghimmo Codex
    provider: openai
    model: nghi/gpt-5.5
    apiBase: https://api.nghimmo.com/v1
    apiKey: sk-xxxxxxxxxxxx

LobeChat, NextChat, Open WebUI… — mọi app OpenAI compatible:

Base URL : https://api.nghimmo.com/v1
API Key  : sk-xxxxxxxxxxxx
Model    : nghi/gpt-5.5
  1. Chatbox → Settings → Model Provider → OpenAI API Compatible
  2. API Host https://api.nghimmo.com/v1 · Key sk-...
  3. Thêm nghi/gpt-5.5 → Test

Kết nối

Base URLhttps://api.nghimmo.com/v1
KeyAPI Key Cursor (tạo ở trang admin → tab API Cursor)
Dùng key Cursor (tạo ở admin), không phải key Claude/Grok/Codex. Route qua Cursor account OAuth — quota Grok Bot theo tuần.
Lưu ý: composer-2.5 là model agent của Cursor, chỉ chạy ổn trong Cursor IDE; client khác (VS Code/Copilot/Cline) làm task code dễ lỗi 400 → nên dùng nghi/grok-4.6.

Model

Composer

ModelGhi chú
nghi/composer-2.5Composer mặc định (chỉ dùng trong Cursor IDE)
nghi/composer-2.5-fastComposer nhanh (chỉ dùng trong Cursor IDE)

Grok (23 model)

Grok 4.6 là mới nhất trong Cursor. Mặc định: nghi/grok-4.6. Khuyên dùng cho client ngoài Cursor.

ModelGhi chú
nghi/grok-4.6Mới nhất — Cursor Grok 4.6 (khuyên dùng)
nghi/grok-4.6-fastGrok 4.6 Fast
nghi/grok-4.5Grok 4.5
nghi/grok-4.5-highGrok 4.5 High
nghi/grok-4.5-mediumGrok 4.5 Medium
nghi/grok-4.5-lowGrok 4.5 Low
nghi/grok-4.3Grok 4.3
nghi/grok-4.20Grok 4.20
nghi/grok-4.2Grok 4.2 (4.20 Beta)
nghi/grok-4.1-thinkingGrok 4.1 Thinking
nghi/grok-4.1-expertGrok 4.1 Expert
nghi/grok-4.1-fastGrok 4.1 Fast
nghi/grok-4.1-miniGrok 4.1 Mini (Thinking)
nghi/grok-4-heavyGrok 4 Heavy (SuperGrok)
nghi/grok-4-thinkingGrok 4 Thinking
nghi/grok-4-fast-reasoningGrok 4 Fast Reasoning
nghi/grok-4-miniGrok 4 Mini (Thinking)
nghi/grok-4Grok 4
nghi/grok-3-thinkingGrok 3 Thinking
nghi/grok-3-miniGrok 3 Mini (Thinking)
nghi/grok-3Grok 3
nghi/grok-code-fast-1Grok Code Fast 1
Tất cả 25 model trên đều route qua Cursor account. Sai tên → lỗi. Làm task code qua client ngoài Cursor: ưu tiên Grok, tránh Composer.

Cài đặt

Cline / Roo Code: Settings → API Provider OpenAI Compatible → điền:

Base URL : https://api.nghimmo.com/v1
API Key  : (key Cursor từ admin)
Model    : nghi/grok-4.6

Continue: sửa ~/.continue/config.yaml:

models:
  - name: Cursor Grok 4.6
    provider: openai
    model: nghi/grok-4.6
    apiBase: https://api.nghimmo.com/v1
    apiKey: (key Cursor từ admin)

Composer (nghi/composer-2.5) chỉ chạy ổn trong Cursor IDE. Client khác nên dùng Grok.

cURL / Python / bất kỳ OpenAI SDK:

curl https://api.nghimmo.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_CURSOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nghi/grok-4.6","messages":[{"role":"user","content":"Hello"}]}'

Tiết kiệm token

Token còn lại

Dán key vào trang check là thấy.

Kiểm tra key