Claude Certified Associate - Foundations cheat sheet
Claude Certified Associate - Foundations ยท Keep the key ideas within reach.
Claude Fundamentals and Model Landscape
Three model families: Haiku (fastest, lowest cost), Sonnet (balanced default), Opus (highest capability, highest latency and cost).
Model IDs follow claude---, e.g. claude-3-5-sonnet-20241022; dated IDs are fixed snapshots and should be pinned in production.
Selection rule: choose the smallest model that passes the eval suite; escalate a tier only when the accuracy gap is measurable and worth the cost.
Claude models are trained with Constitutional AI plus reinforcement learning from human feedback toward helpful, honest, and harmless behavior.
Current access is through the Messages API (POST /v1/messages); the legacy text-completions endpoint is not the interface used for new work.
Multimodal input: current models accept images alongside text in the same messages array, with images costing tokens by pixel area.
Extended thinking is optional on some models and trades extra output tokens and latency for stronger performance on hard reasoning tasks.
Context window size and maximum output length differ per model; read the specific model card rather than assuming parity across the family.
Prompt Design and Prompt Engineering Techniques
Prompt anatomy: system prompt sets role and rules, user turn carries task plus data, optional assistant turn prefills the start of the answer.
Specificity rule: state task, audience, output format, length, and constraints explicitly; underspecified prompts produce high-variance output.
Place long reference documents before the question, and ask for verbatim supporting quotes first so the answer is grounded in the text.
XML-style tags such as , , and create reliable section boundaries in long or mixed-content prompts.
Few-shot rule: use three to five diverse examples with identical formatting, and include at least one edge or boundary case.
Prefill the assistant turn to lock format - an opening brace for JSON, a fixed label for classification, a tag for XML output.
Chain-of-thought: request step-by-step reasoning before the conclusion for multi-constraint or numeric tasks; skip it for simple extraction where it only adds tokens.
Positive framing beats prohibition: state the desired behavior, because 'do not' rules alone leave the correct alternative unspecified.
Temperature: 0 for extraction, classification, and routing; roughly 0.7-1.0 for ideation; top_p is an alternative nucleus-sampling control, not a second knob to tune simultaneously.
API and Integration Essentials
Endpoint is POST https://api.anthropic.com/v1/messages with headers x-api-key, anthropic-version, and content-type: application/json.
Required body fields: model, max_tokens, messages. Common optional fields: system, temperature, top_p, stop_sequences, tools, stream.
The messages array must begin with a user role and alternate user/assistant; system is a separate top-level field, never a message role.
Response shape: content[] blocks (text or tool_use), stop_reason, stop_sequence, and usage with input_tokens and output_tokens.
Tool use: declare name, description, and input_schema (JSON Schema); the model returns a tool_use block and you return a tool_result block in a user turn.
Streaming with stream:true returns server-sent events - message_start, content_block_start/delta/stop, message_delta, message_stop.
Error map: 400 malformed request, 401 invalid key, 403 forbidden, 413 payload too large, 429 rate limited, 500 server error, 529 overloaded.
Retry rule: exponential backoff with jitter on 429, 500, and 529; never blind-retry 400, 401, or 403 because the request itself must change.
Context, Token, and Output Management
Budget equation: input_tokens plus output_tokens must fit inside the context window; max_tokens reserves room for the generated answer.
English estimate: about four characters or 0.75 words per token; confirm exact counts with the /v1/messages/count_tokens endpoint before large sends.
stop_reason 'max_tokens' means the reply was truncated mid-thought; fix by raising max_tokens or by shortening the requested output.
Prompt caching places cache_control breakpoints on stable prefixes; cache writes cost slightly more, cache reads cost far less and run faster.
Ordering for cache hits: system prompt, static documents, and few-shot examples first; user-specific variable content goes last.
Long-context strategy: retrieve, rerank, then trim to the most relevant chunks; summarize older turns in multi-turn conversations.
Images consume tokens roughly proportional to width times height divided by 750, so downscale or crop before sending when fine detail is unnecessary.
Streaming reduces time-to-first-token only; billed input and output tokens are identical to a non-streaming request.
Safety, Alignment, and Responsible Use
Constitutional AI has the model critique and revise its own outputs against written principles during training, reducing reliance on human harm labels.
The helpful, honest, harmless objectives can conflict; honesty requires expressing uncertainty rather than inventing confident answers.
Refusals are a trained behavior: harmful requests are declined, and reframing, role-play, or hypothetical framing does not change the underlying policy.
Prompt injection: any retrieved or user-supplied text can carry instructions - delimit it, label it as data, and never let it override system rules.
Tool safety: grant least-privilege credentials and require human confirmation before irreversible or high-value actions the model proposes.
Data handling: redact names, identifiers, and secrets before sending content to the API, then map placeholders back locally.
Sycophancy risk: models may mirror a stated user opinion, so elicit an independent assessment before revealing the answer you expect.
High-stakes domains such as medical, legal, and financial output require human review and disclosure that the content is AI-generated.
Evaluation, Testing, and Workflow Integration
Eval set construction: sample real traffic, label against a written rubric, and freeze a held-out test split that is never used for prompt tuning.
Grading methods by output type: exact match or schema validation for structured output, rubric-based LLM-as-judge for open text, human review for gold sets.
Judge design: supply the rubric, require reasoning before the score, and calibrate judge-human agreement with a statistic such as Cohen's kappa.
Compare prompt variants on identical inputs at temperature 0, reporting accuracy, latency, and cost per request rather than accuracy alone.
Regression suite runs on every prompt edit and model upgrade; pinning dated model IDs makes version changes deliberate instead of silent.
Error analysis loop: cluster real failures, rank by frequency times severity, fix the top cluster, then rerun the suite to confirm no regressions.
Instrumentation: log request ID, model ID, prompt version, token usage, stop_reason, and latency for every call to enable later diagnosis.
Rollout pattern: canary or shadow a new prompt on a traffic slice with predefined rollback criteria before switching all traffic.