https://api.monkeytech.vn

← Tất cả ứng dụng · Mục lục trên /docs

AnthropicCấu hình tay

Python (anthropic)

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

URL gốc phải dán

Dán đúng một trong hai kiểu — sai sẽ ra 404 (không phải 401).

https://api.monkeytech.vn

Chuẩn bị

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

Model khuyến nghị: claude-fable-5

Cách nhanh — lệnh / cấu hình

from anthropic import Anthropic

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

Bỏ file / điền Settings ở đâu

Biến môi trườngany
shell / .env
export sk-mtk-...=sk-mtk-...
# Trong code: api_key="sk-mtk-...", base_url="https://api.monkeytech.vn"

Kiểm tra đã chạy đúng

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

Lỗi thường gặp

Triệu chứngNguyên nhânCách xử lý
404base_url có thừa /v1.Dùng https://api.monkeytech.vn (SDK tự thêm /v1/messages).

Liên quan

Python (openai) · Node.js

Zalo support