Anthropic Messages API provider, or any endpoint that speaks the same format
(e.g. Z.AI's /api/anthropic, which serves GLM models natively in Anthropic
form).
Two auth modes (mirroring the Anthropic SDK):
:api_key→ sent asx-api-key(real Anthropic,ANTHROPIC_API_KEY).:auth_token→ sent asAuthorization: Bearer(Z.AI coding plan,ANTHROPIC_AUTH_TOKEN).
Examples
# Real Anthropic
ExAgent.Models.Anthropic.new(model: "claude-3-5-haiku-20241022")
# Z.AI's Anthropic-compatible endpoint, cheap model
ExAgent.Models.Anthropic.new(
model: "glm-4.5-air",
auth_token: System.fetch_env!("ZAI_API_KEY"),
base_url: "https://api.z.ai/api/anthropic"
)