AI Engine — ClaudeAI provider · Anthropic

Run Anthropic Claude models in Melis

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.

Live demo
provider — Anthropic Claude
// 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.
Messages APItool_use blocks
Prompt cachingweb_fetch

Package

melis-ai-engine-claude

Role

AI provider

Vendor

Anthropic

API

Messages

Message key

messages

Tables

None — stateless

Overview

How Melis talks to Claude

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

A provider built for agentic Claude

The Messages API, content blocks, the tool-use loop and Anthropic’s caching and web tools — wired into the engine’s contract.

Messages API

Talks to Anthropic’s Messages endpoint with the model’s API key.

Content blocks

Text, image and document (PDF) blocks built per the contract.

Tool use

Parses tool_use, dispatches each tool, feeds tool_result back, loops until end_turn.

Prompt caching

Enables Anthropic prompt caching to cut cost on repeated context.

Built-in web_fetch

Appends Anthropic’s web_fetch tool automatically.

Tokens & files

Reads usage (input/output + cache); embeds files (base64 / extracted text) by default.

See it in action

Engine tools mapped to Anthropic shape

The provider implements the engine contract and forwards your tools as Anthropic input_schema — then loops on tool_use until the turn ends.

provider — tool mapping
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
}
end_turnloops until done
Mapping

Engine tools → Anthropic shape

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.

  • Message key: messages
  • Roles: user / assistant
  • tool_use_id correlates call ↔ result

For developers

How it's wired

Auth & version

x-api-key (the model’s key) plus the anthropic-version header; a long timeout for tool loops.

Stateless

No tables — conversation state lives in the engine.

DB-only key

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

Explore the rest of the platform

The Claude provider plugs into the AI engine — here are the modules around it.

Add Claude to your platform

See agentic AI running on Anthropic Claude.