Count tokens (LangChain - Anthropic format)
/langchain/anthropic/v1/messages/count_tokensCounts tokens using Anthropic-compatible format via LangChain.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:8080/langchain/anthropic/v1/messages/count_tokens" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-3-opus-20240229", "max_tokens": 0, "messages": [ { "role": "user", "content": "string" } ] }'{
"input_tokens": 0
}{
"type": "error",
"error": {
"type": "string",
"message": "string"
}
}{
"type": "error",
"error": {
"type": "string",
"message": "string"
}
}WebSocket connection GET
Upgrades to a WebSocket connection for real-time updates. Server pushes log events, MCP log events, and store update notifications. Heartbeat pings are sent every 30 seconds.
Create message (LangChain - Anthropic format) POST
Creates a message using Anthropic-compatible format via LangChain.