Follow Discord
Sweep 27 Oct 2026 · 19:04Z Build v2.1.312 531 read Stable v2.1.308 Latest v2.1.312 Next v2.1.312 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

typescript changedcli-sdks-libraries/sdks/typescript

Nearest release: v2.1.312, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+8added
Lines−8removed
From line 55 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits15to this page, all time

The whole hunk

from line 55, old and new numbered
/
lines
from line 55
5555}
5656```
5757 
58For authentication options including Workload Identity Federation, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). If your API key is a [personal or service account key](https://platform.claude.com/docs/en/manage-claude/authentication#key-types) that isn't scoped to a workspace, set the workspace ID in the `anthropic-workspace-id` request header; [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace) shows the per-request option for this SDK.
58For authentication options including Workload Identity Federation, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). If your API key is a [personal or service account key](https://platform.claude.com/docs/en/manage-claude/authentication#key-types) that isn’t scoped to a workspace, set the workspace ID in the `anthropic-workspace-id` request header; [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace) shows the per-request option for this SDK.
5959 
6060## Request and response types
6161 
from line 279
279279 
280280### MCP error handling
281281 
282The conversion functions throw `UnsupportedMCPValueError` if an MCP value isn't supported by the Claude API (for example, unsupported content type, unsupported MIME type, non-HTTP/HTTPS resource link).
282The conversion functions throw `UnsupportedMCPValueError` if an MCP value isn’t supported by the Claude API (for example, unsupported content type, unsupported MIME type, non-HTTP/HTTPS resource link).
283283 
284284## Message batches
285285 
from line 545
545545 
546546### Accessing raw Response data (for example, headers)
547547 
548The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return. This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
548The “raw” `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return. This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
549549 
550550You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data. Unlike `.asResponse()`, this method consumes the body, returning once it is parsed.
551551 
from line 604
604604 
605605#### Custom logger
606606 
607By default, this library logs to `globalThis.console`. You can also provide a custom logger. Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, open an issue.
607By default, this library logs to `globalThis.console`. You can also provide a custom logger. Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn’t work, open an issue.
608608 
609609When providing a custom logger, the `logLevel` option still controls which messages are emitted; messages below the configured level are not sent to your logger.
610610 
from line 640
640640 
641641#### Undocumented request parameters
642642 
643To make requests using undocumented parameters, you can use `// @ts-expect-error` on the undocumented parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you send are sent as-is.
643To make requests using undocumented parameters, you can use `// @ts-expect-error` on the undocumented parameter. This library doesn’t validate at runtime that the request matches the type, so any extra values you send are sent as-is.
644644 
645645```typescript
646646client.messages.create({
from line 734
734734 
735735## Beta features
736736 
737Beta features are available before general release to get early feedback and test new functionality. You can check the availability of all of Claude's capabilities and tools in the [Features overview](https://platform.claude.com/docs/en/build-with-claude/overview).
737Beta features are available before general release to get early feedback and test new functionality. You can check the availability of all of Claude’s capabilities and tools in the [Features overview](https://platform.claude.com/docs/en/build-with-claude/overview).
738738 
739739You can access most beta API features through the `beta` property of the client. To enable a particular beta feature, you need to add the appropriate [beta header](https://platform.claude.com/docs/en/api/beta-headers) to the `betas` field when creating a message.
740740 
from line 760
760760 In certain scenarios where enabling browser support might not pose significant risks:
761761 
762762 * **Internal tools:** If the application is used solely within a controlled internal environment where the users are trusted, the risk of credential exposure can be mitigated.
763 * **Development or debugging purpose:** Enabling this feature temporarily might be acceptable, provided the credentials are short-lived, aren't also used in production environments, or are frequently rotated.
763 * **Development or debugging purpose:** Enabling this feature temporarily might be acceptable, provided the credentials are short-lived, aren’t also used in production environments, or are frequently rotated.
764764</Accordion>
765765 
766766## Platform integrations
from line 796
796796 
7977971. Changes that only affect static types, without breaking runtime behavior.
7987982. Changes to library internals that are technically public but not intended or documented for external use.
7993. Changes that aren't expected to impact the vast majority of users in practice.
7993. Changes that aren’t expected to impact the vast majority of users in practice.
800800 
801801Backward compatibility is taken seriously to ensure you can rely on a smooth upgrade experience.
802802 
Feedback