The Claude provider implements the AI engine’s contract for Anthropic’s Messages API — selected automatically when a model’s company is Anthropic. Just add a Claude model, store the key, and point an agent at it.
// Use Claude: // 1. create a model whose company is Anthropic // 2. model id like 'claude-…', store the API key // 3. point an agent / instance at it // The engine routes here by company name — // every chat then goes through Claude.
Package
Role
Vendor
API
Message key
Tables
Overview
MelisAIEngineModelClaudeService extends the engine contract and POSTs to Anthropic’s Messages API with the model’s API key (x-api-key) and the anthropic-version header. It builds Anthropic content blocks — text, image and document (PDF).
It parses tool_use blocks, dispatches each tool (MCP or built-in), feeds the tool_result back, and loops until stop_reason is end_turn. Anthropic prompt caching and a built-in web_fetch tool are enabled automatically.
Key features
The Messages API, content blocks, the tool-use loop and Anthropic’s caching and web tools — wired into the engine’s contract.
Talks to Anthropic’s Messages endpoint with the model’s API key.
Text, image and document (PDF) blocks built per the contract.
Parses tool_use, dispatches each tool, feeds tool_result back, loops until end_turn.
Enables Anthropic prompt caching to cut cost on repeated context.
Appends Anthropic’s web_fetch tool automatically.
Reads usage (input/output + cache); embeds files (base64 / extracted text) by default.
See it in action
The provider implements the engine contract and forwards your tools as Anthropic input_schema — then loops on tool_use until the turn ends.
class MelisAIEngineModelClaudeService extends MelisAIEngineModelService { public function getMessageKey(): string { return 'messages'; } // addToolsToPayload(): Anthropic input_schema, + web_fetch // sendCustomAI(): parse tool_use → dispatch → loop to end_turn }
Engine tools already use Anthropic’s input_schema, so the provider sanitises and forwards them; a tool_use call is correlated to its result by id.
For developers
x-api-key (the model’s key) plus the anthropic-version header; a long timeout for tool loops.
No tables — conversation state lives in the engine.
The API key comes from the model’s platform key, not an environment variable.
// Selected when the model's company contains 'Anthropic'. // Returns tool results as {type:'tool_result', tool_use_id, content} // inside a user message, then continues until stop_reason==='end_turn'.
Part of Melis Platform
The Claude provider plugs into the AI engine — here are the modules around it.
See agentic AI running on Anthropic Claude.