Langchain integration

Create message (LangChain - Anthropic format)

POST/langchain/anthropic/v1/messages

Creates a message 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

curl -X POST "http://localhost:8080/langchain/anthropic/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "model": "claude-3-opus-20240229",    "max_tokens": 0,    "messages": [      {        "role": "user",        "content": "string"      }    ]  }'
{
  "id": "string",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "string",
      "thinking": "string",
      "signature": "string",
      "data": "string",
      "tool_use_id": "string",
      "id": "string",
      "name": "string",
      "input": {},
      "server_name": "string",
      "content": "string",
      "source": {
        "type": "base64",
        "media_type": "string",
        "data": "string",
        "url": "string"
      },
      "cache_control": {
        "type": "ephemeral",
        "ttl": "string"
      },
      "citations": {
        "enabled": true
      },
      "context": "string",
      "title": "string"
    }
  ],
  "model": "string",
  "stop_reason": "end_turn",
  "stop_sequence": "string",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 0
    }
  }
}
{
  "type": "error",
  "error": {
    "type": "string",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "string",
    "message": "string"
  }
}