AI4AIOpen in AI4AI →
Providers · Docs

🟠 Claude

Always-current AI documentation · Verified 2026-06-10
TL;DR

• Anthropic's model family — flagship Fable 5, balanced Sonnet, fast Haiku

• Strongest at coding, agents, and long documents (200K context)

• Use prompt caching + the Batch API to cut costs dramatically

Getting started

Get an API key from the Anthropic Console, install the SDK (`npm i @anthropic-ai/sdk` or `pip install anthropic`), and call the Messages API. Set the key via the ANTHROPIC_API_KEY environment variable — never hardcode it.

Prompting Claude well

Use XML-style tags to separate instructions from data (<instructions>, <document>). Put persistent rules in the system prompt. For structured output, show the exact JSON shape or prefill the assistant turn with `{`.

Cutting costs

Prompt caching: mark your stable prefix (system prompt, examples, docs) — cache reads cost ~10% of normal input. Batch API: 50% off for async jobs with results within 24h. Together they routinely cut bills 60–80%.

Learn it properly

Take the related AI4AI course →
Open the live Docs Hub →
AI4AI — Academic Institute For Artificial Intelligence · Built by mAIb Tech · Courses · Docs · support@maib.io