Claude Code

Claude Code អាន endpoint និង credential ពីអថេរបរិស្ថានពីរ។ ភ្ជាប់ ANTHROPIC_BASE_URL ទៅ gateway ហើយកំណត់ ANTHROPIC_API_KEY ទៅ key sk- ផ្ទាល់ខ្លួនរបស់អ្នក។ គ្មានអ្វីផ្សេងផ្លាស់ប្តូរទេ — Claude Code នៅតែប្រើទម្រង់ Anthropic Messages ដែល gateway និយាយដោយធម្មជាតិ។

កំណត់សម្រាប់វគ្គតែមួយ

Export អថេរទាំងនេះ មុនពេលបើក Claude Code៖

bash
export ANTHROPIC_BASE_URL="https://api.hashn0de.com"
export ANTHROPIC_API_KEY="sk-your-key"

claude

ធ្វើឱ្យអចិន្ត្រៃយ៍

បន្ថែមបន្ទាត់ពីរដូចគ្នាទៅ shell profile (~/.zshrc ឬ ~/.bashrc) ដើម្បីឱ្យ shell ថ្មីៗទាញយកវា៖

bash
echo 'export ANTHROPIC_BASE_URL="https://api.hashn0de.com"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="sk-your-key"' >> ~/.zshrc
source ~/.zshrc

ផ្ទៀងផ្ទាត់

បើក Claude Code ហើយផ្ញើសារ។ ឥឡូវសំណើហូរកាត់ gateway។ ដើម្បីបញ្ជាក់ endpoint ដោយមិនបើក TUI៖

bash
curl https://api.hashn0de.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "ping"}]
  }'

គន្លឹះ៖ ដើម្បីប្តូរត្រឡប់ទៅ Anthropic ដោយផ្ទាល់ សូម unset ANTHROPIC_BASE_URL ឬលុបបន្ទាត់ចេញពី profile របស់អ្នក។