https://vietrouter.com.vn

← All applications · Connect apps section on /docs

AnthropicManual setup

Python (anthropic)

SDK chính thức Anthropic trỏ base_url Vietrouter.

Base URL to paste

Paste exactly one of two formats — wrong URL yields 404 (not 401).

https://vietrouter.com.vn

Prerequisites

  1. pip install anthropic
  2. Biến môi trường sk-mtm-...

Recommended model: claude-fable-5

Quick way — command / config

from anthropic import Anthropic

client = Anthropic(api_key="sk-mtm-...", base_url="https://vietrouter.com.vn")
msg = client.messages.create(
    model="claude-fable-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(msg.content[0].text)

Where to place file / fill Settings

Environment variableany
shell / .env
export sk-mtm-...=sk-mtm-...
# Trong code: api_key="sk-mtm-...", base_url="https://vietrouter.com.vn"

Verify connection

  1. Chạy script
  2. Thấy x-mientaymedia-cost-vnd trên response headers nếu log HTTP

Troubleshooting

SymptomReasonHow to handle
404base_url có thừa /v1.Dùng https://vietrouter.com.vn (SDK tự thêm /v1/messages).

Related

Python (openai) · Node.js

Zalo groupWhatsApp