5.2 — Technical Fundamentals
CCDV-F Domain 5 · Task 5.2
What You Need to Know
A Claude application talks to the API over HTTP with JSON. Official SDKs wrap the wire in seven languages (Python, TypeScript, C#, Go, Java, PHP, Ruby) plus the ant CLI.
What the SDK Wraps
- Credential resolution and anthropic-version header
- Typed request construction and typed responses
- Typed exception hierarchy mapped from status codes
- Automatic retry of the transient class with backoff; default timeout 10 minutes
- SSE parsed into typed events
- Request id exposed as
_request_id - Auto-pagination over list endpoints
Exception Classes (most-specific-first)
| Status | Exception |
|---|---|
| 400 | BadRequestError |
| 401 | AuthenticationError |
| 403 | PermissionDeniedError |
| 404 | NotFoundError |
| 409 | ConflictError |
| 422 | UnprocessableEntityError |
| 429 | RateLimitError |
| ≥500 | InternalServerError |
| transport | APIConnectionError |
Branch on the exception class, never on the message text. Spend-cap 429 has error_code enforced_spend_limit_reached and no retry-after — do not retry.
Retry and Timeout Defaults
Certain errors retried 2 times by default with exponential backoff. Default timeout 10 minutes. Worst-case wall-clock ≈ timeout × attempts. Set both on purpose at one layer. Your own three-attempt loop on top of defaults multiplies attempts and re-sends deterministic failures.
Pagination
List endpoints return pages. Request takes limit + optional after_id/before_id. Response carries data, has_more, first_id, last_id. Page size defaults to 20, tops out at 1,000. SDK auto-paginates on iteration.
What the SDK Does Not Change
Same models, same pricing, same rate limits. No service-level guarantee. Does not manage your context window, prompt or cost.
Escape Hatches (without dropping the SDK)
.with_raw_response/.with_streaming_responsefor headers and statusANTHROPIC_LOG=debugfor traffic (keep out of production)extra_body/extra_query/extra_headersfor fields types lagclient.get/client.postfor unwrapped endpointsclient.betawith betas list for beta features
Transports
Three shapes: plain request/response (code consumer), streaming SSE (person watching), websocket (bidirectional). Choose by the consumer, not by preference.
Check your understanding
Practice Scenario
🔒 This practice scenario is part of Skillmarked Pro
The lessons stay free. Pro unlocks the other 24 CCDV-F practice scenarios and the 53-question timed mock exam, plus everything for every other exam.
Cancel anytime. Or €199 a year, which saves 17%.
Not sure yet? Try 10 free mock exam questions.
Already Pro? Log in.
Sources
- SDKs, CLI, and libraries, Claude Platform Docs
- Python SDK, Claude Platform Docs
- TypeScript SDK, Claude Platform Docs
- Claude API errors, Claude Platform Docs