Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Anthropic Messages API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Anthropic Messages API.
Send a prompt to Claude with system instructions, tool definitions, and multi-turn conversation history
Receive structured tool-use responses that an agent can dispatch and feed back to Claude on the next turn
Stream tokens from the Messages endpoint for low-latency chat surfaces
GET STARTED
For Agents
Send messages to Claude for reasoning, code, and analysis tasks; count tokens before dispatch to manage cost and context. Two-endpoint surface focused on synchronous Messages API usage.
Use for: I need to send a message to Claude for complex reasoning, Generate code with Claude for a Python refactor task, Count tokens in my prompt before sending it to Claude, Stream Claude's response token-by-token to a chat UI
Not supported: Does not handle message batches, model listing, fine-tuning, or admin operations - use for synchronous Claude message completions and token counting only.
Send prompts to Anthropic's Claude models for text generation, reasoning, and code tasks through the Messages API. Two endpoints cover the core flow: POST /messages for synchronous chat completions with system prompts, tool use, and large-context inputs, and POST /messages/count_tokens for cost-aware token estimation before a request is dispatched. Anthropic's documentation accepts either an API key in the X-API-Key header or an Authorization bearer token, and every call also carries a required anthropic-version header plus an optional anthropic-beta header for opting into preview features. Suited to agent workflows that need long-context reasoning, structured tool calls, or precise cost control.
Count tokens for a planned messages payload before sending to estimate cost and stay within context limits
Opt into Anthropic preview features via the anthropic-beta header without changing the request body
Pin model behaviour to a specific version using the anthropic-version header for reproducible runs
Patterns agents use Anthropic Messages API for, with concrete tasks.
★ Long-Context Reasoning
Send a single POST /messages request carrying a large prompt for tasks like multi-document summarisation, codebase Q&A, or contract review. Claude handles large inputs without forcing the agent to chunk and stitch responses, which simplifies retrieval-augmented prompts. The context window is a property of the model you select rather than of the endpoint, so pair the call with /messages/count_tokens beforehand to confirm the payload fits the model you intend to use.
Call POST /messages/count_tokens with the planned messages and system prompt; if the count fits the selected model's context window, call POST /messages with the same payload and the model id you intend to use
Tool-Use Agent Loop
Drive an agent loop where Claude returns tool_use blocks indicating which tool to call next. The host runtime executes the tool, returns the result as a tool_result message, and POSTs the appended history back to /messages. This is the canonical Anthropic pattern for agent orchestration without an external framework, and it lets the same Messages endpoint power both single-shot completions and multi-step agentic workflows.
Send POST /messages with tool definitions, parse the tool_use block from the response, execute the tool, then POST /messages again with the tool_result appended to the conversation
Cost-Aware Prompt Sizing
Estimate token usage before sending a request by calling POST /messages/count_tokens with the same messages and system prompt the agent intends to send. Use the returned count to choose between a smaller and larger Claude model, decide whether to truncate retrieved documents, or stop a runaway agent that is about to exceed a budget cap. Anthropic documents token counting as free to use, subject to its own requests-per-minute limit tied to your usage tier.
Call POST /messages/count_tokens with the candidate messages and system prompt; if the count exceeds 100K, summarise retrieved chunks before calling POST /messages
AI Agent Reasoning via Jentic
An AI agent that needs Claude reasoning can invoke the Messages API through Jentic without managing the X-API-Key header directly. Jentic's intent search returns POST /messages with the messages and tool schema, and your own Jentic One instance injects the API key at execution time so it never enters the agent's tool context. This is especially relevant when the agent itself is built on a different model and delegates selected reasoning steps to Claude.
Search Jentic for 'send a message to Claude', load POST /messages, and execute with the user's question and a system prompt for the delegated reasoning step
2 endpoints — send prompts to anthropic's claude models for text generation, reasoning, and code tasks through the messages api.
METHOD
PATH
DESCRIPTION
/messages
Send a message to Claude and receive a completion
/messages/count_tokens
Count tokens for a planned messages payload
/messages
Send a message to Claude and receive a completion
/messages/count_tokens
Count tokens for a planned messages payload
Three things that make agents converge on Jentic-routed access.
Credential isolation
Your Anthropic X-API-Key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'send a message to Claude' or 'count tokens for a message', and Jentic returns the matching Messages operation with its input schema so the agent calls the right endpoint without constructing the headers manually.
Time to first call
Alternatives and complements available in the Jentic catalogue.
Specific to using Anthropic Messages API through Jentic.
Which OpenAPI specification does this Anthropic Messages API page describe?
This page describes a Jentic-authored, agent-optimized specification scoped to the two synchronous Messages operations, POST /messages and POST /messages/count_tokens, and validated against the live API. Anthropic also publishes an official machine-readable specification covering its whole Claude API surface, at `https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-891ba7f96c3771e1e3ba6cb37fe8cb6d8615b8a06b6c435d9df66f4aad144bb4.yml`. That document is pinned from the `.stats.yml` file of Anthropic's own anthropic-sdk-python repository, which is where the current version is published when the pinned URL changes. Both operations described here are present in it.
What authentication does the Anthropic Messages API use?
Anthropic's documentation lists two alternatives and requires one of them: an API key in the X-API-Key header, or an Authorization bearer token holding a short-lived access token. Every call also carries a required anthropic-version header that pins the API behaviour, plus an optional anthropic-beta header for preview features. Through Jentic the API key is stored encrypted by your own Jentic One instance and injected at execution time, so the raw key never enters the agent's prompt context.
Can I count tokens before sending a message to Claude?
Yes. POST /messages/count_tokens accepts the same messages and system prompt shape as POST /messages and returns the token count. Anthropic documents token counting as free to use but subject to its own requests-per-minute rate limit, held separately from the message-creation limit, so counting does not draw down your sending budget. Use it to keep a request inside the selected model's context window or inside a cost cap.
What are the rate limits for the Anthropic Messages API?
The OpenAPI spec does not declare explicit rate limits. Anthropic's documentation measures Messages API limits as requests per minute, input tokens per minute, and output tokens per minute for each model class, set at the organisation level and varying by usage tier. Exceeding one returns a 429 naming the limit that was exceeded, along with a retry-after header indicating how long to wait, so back off on 429 responses and check your tier in the Claude Console.
How do I send a message to Claude through Jentic?
Install Jentic One from its GitHub repo, import the Anthropic Messages API from the API Directory, and store your API key once. Then search Jentic for 'send a message to Claude'. Jentic returns POST /messages with the full messages, system, and tools schema. Execute it with your model id and conversation history; your Jentic One instance injects the X-API-Key at call time.
Does the Messages API support tool use and streaming?
Yes. POST /messages accepts a tools array and returns tool_use blocks the agent dispatches and feeds back via tool_result messages. The same endpoint supports server-sent event streaming when the request enables it, so chat surfaces can render tokens as they arrive.
Why are anthropic-version and anthropic-beta declared as security headers in the spec?
Anthropic requires the anthropic-version header on every Messages call and uses anthropic-beta to gate preview features. This specification models them as apiKey security schemes to signal that clients must send them alongside X-API-Key, even though they are not secrets in the credential sense. Treat the requirement as coming from Anthropic's documentation rather than from the schemes themselves: Anthropic's official specification declares no security schemes at all and marks anthropic-version as an ordinary optional header.
Is there an Anthropic Messages API MCP server?
You do not need an MCP server to give your agent the Anthropic Messages API. Jentic connects it directly from the API Directory: import it, store your API key once, and your agent calls it without loading another server's tool definitions into its context.
Can I limit what my agent is allowed to do with the Anthropic Messages API?
Yes. This specification exposes two operations, sending a message and counting tokens, and your rules decide which of them the agent may call. The Messages API carries the conversation content in the request body rather than a resource id in the URL path, so rules bound which operations run rather than which individual conversations.