POST /v1/messages
Endpoint chuẩn Anthropic, dùng cho model Claude.
curl -s https://ai.gamikey.com/v1/messages \
-H "x-api-key: sk-..." \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 64,
"messages": [{"role": "user", "content": "ping"}]
}'- Thêm
"stream": trueđể nhận câu trả lời từng phần (SSE). - Câu trả lời có thể có khối
thinkingtrước khốitext— chỉ lấy các khối"type": "text". POST /v1/messages/count_tokenstrả số token ước tính trước khi gọi.
Cập nhật: 02/12/2026Thấy lỗi trong tài liệu? Chat với Gamikey