Anthropic Messages API
Anthropic Messages API MCP connector (beta): mcp_servers plus an mcp_toolset — Claude calls aicharged.io straight from the API.
- API key (Bearer)
Hosted MCP tool — the API calls aicharged.io for you
Recommendedimport os
import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
betas=["mcp-client-2025-11-20"],
messages=[{"role": "user", "content": "List my recent aicharged.io runs"}],
mcp_servers=[{
"type": "url",
"url": "https://aicharged.io/api/v1/mcp",
"name": "aicharged",
"authorization_token": os.environ["AICHARGED_API_KEY"],
}],
tools=[{"type": "mcp_toolset", "mcp_server_name": "aicharged"}],
)
print(response.content)
Beta feature: keep the mcp-client-2025-11-20 beta flag. The API sends authorization_token to aicharged.io as the Bearer token.
The same request with curl
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: mcp-client-2025-11-20" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 16000,
"messages": [{"role": "user", "content": "List my recent aicharged.io runs"}],
"mcp_servers": [{"type": "url", "url": "https://aicharged.io/api/v1/mcp", "name": "aicharged", "authorization_token": "<API_KEY>"}],
"tools": [{"type": "mcp_toolset", "mcp_server_name": "aicharged"}]
}'