diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f7e8d650..db36e4bc 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,5 +1,5 @@
 {
-  ".": "0.27.3",
-  "packages/vertex-sdk": "0.4.1",
-  "packages/bedrock-sdk": "0.10.2"
+  ".": "0.28.0",
+  "packages/vertex-sdk": "0.4.2",
+  "packages/bedrock-sdk": "0.10.3"
 }
diff --git a/.stats.yml b/.stats.yml
index 49961a7f..d93eaabd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 3
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-fb94a03f85580f7eacef034518becfb463502e6d74b0f7932f6153239de23a5b.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-209cf750b141ebe030a31486ce555fa23b87436cd4235e997b989dfe70dd1b0b.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed3f9175..104810fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,33 @@
 # Changelog
 
+## 0.28.0 (2024-10-04)
+
+Full Changelog: [sdk-v0.27.3...sdk-v0.28.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.27.3...sdk-v0.28.0)
+
+### Features
+
+* **api:** support disabling parallel tool use ([#540](https://github.com/anthropics/anthropic-sdk-typescript/issues/540)) ([df0032f](https://github.com/anthropics/anthropic-sdk-typescript/commit/df0032f263884190b31a63ddcb20429372617deb))
+* **client:** allow overriding retry count header ([#536](https://github.com/anthropics/anthropic-sdk-typescript/issues/536)) ([ec11f91](https://github.com/anthropics/anthropic-sdk-typescript/commit/ec11f9189e9a24f413a9d48b21a10ce88e367ac3))
+* **client:** send retry count header ([#533](https://github.com/anthropics/anthropic-sdk-typescript/issues/533)) ([401b81c](https://github.com/anthropics/anthropic-sdk-typescript/commit/401b81c55c1f998dc917fc268884c162f214df20))
+
+
+### Bug Fixes
+
+* **types:** remove leftover polyfill usage ([#532](https://github.com/anthropics/anthropic-sdk-typescript/issues/532)) ([ac188b2](https://github.com/anthropics/anthropic-sdk-typescript/commit/ac188b29670d409c15e740bca26f8ef488cb7d05))
+
+
+### Chores
+
+* better object fallback behaviour for casting errors ([#503](https://github.com/anthropics/anthropic-sdk-typescript/issues/503)) ([3660e97](https://github.com/anthropics/anthropic-sdk-typescript/commit/3660e977e7127b10446b24b0a76b0133b3f666de))
+* better object fallback behaviour for casting errors ([#526](https://github.com/anthropics/anthropic-sdk-typescript/issues/526)) ([4ffb2e4](https://github.com/anthropics/anthropic-sdk-typescript/commit/4ffb2e4e1f5fef3ae58d9f4c99a63e75dd459c5b))
+* **internal:** add dev dependency ([#531](https://github.com/anthropics/anthropic-sdk-typescript/issues/531)) ([a9c127b](https://github.com/anthropics/anthropic-sdk-typescript/commit/a9c127b2854d0cf7efd49e7d46ff10fe52372949))
+
+
+### Documentation
+
+* improve and reference contributing documentation ([#539](https://github.com/anthropics/anthropic-sdk-typescript/issues/539)) ([cbef925](https://github.com/anthropics/anthropic-sdk-typescript/commit/cbef925519c63f09626ea7aa61ab8ba9d36bc35d))
+* update CONTRIBUTING.md ([#528](https://github.com/anthropics/anthropic-sdk-typescript/issues/528)) ([2609dec](https://github.com/anthropics/anthropic-sdk-typescript/commit/2609dec770d33b828c957e431f2d03871e67e629))
+
 ## 0.27.3 (2024-09-09)
 
 Full Changelog: [sdk-v0.27.2...sdk-v0.27.3](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.27.2...sdk-v0.27.3)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5620404c..9a869b0f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,24 +5,24 @@ Other package managers may work but are not officially supported for development
 
 To set up the repository, run:
 
-```bash
-yarn
-yarn build
+```sh
+$ yarn
+$ yarn build
 ```
 
 This will install all the required dependencies and build output files to `dist/`.
 
 ## Modifying/Adding code
 
-Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
-`src/lib/` and `examples/` directories are exceptions and will never be overridden.
+Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
+result in merge conflicts between manual patches and changes from the generator. The generator will never
+modify the contents of the `src/lib/` and `examples/` directories.
 
 ## Adding and running examples
 
-All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
-added to.
+All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
 
-```bash
+```ts
 // add an example to examples/<your-example>.ts
 
 #!/usr/bin/env -S npm run tsn -T
@@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g
 
 To install via git:
 
-```bash
-npm install git+ssh://git@github.com:anthropics/anthropic-sdk-typescript.git
+```sh
+$ npm install git+ssh://git@github.com:anthropics/anthropic-sdk-typescript.git
 ```
 
 Alternatively, to link a local copy of the repo:
 
-```bash
+```sh
 # Clone
-git clone https://www.github.com/anthropics/anthropic-sdk-typescript
-cd anthropic-sdk-typescript
+$ git clone https://www.github.com/anthropics/anthropic-sdk-typescript
+$ cd anthropic-sdk-typescript
 
 # With yarn
-yarn link
-cd ../my-package
-yarn link @anthropic-ai/sdk
+$ yarn link
+$ cd ../my-package
+$ yarn link @anthropic-ai/sdk
 
 # With pnpm
-pnpm link --global
-cd ../my-package
-pnpm link -—global @anthropic-ai/sdk
+$ pnpm link --global
+$ cd ../my-package
+$ pnpm link -—global @anthropic-ai/sdk
 ```
 
 ## Running tests
 
 Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
 
-```bash
-npx prism mock path/to/your/openapi.yml
+```sh
+$ npx prism mock path/to/your/openapi.yml
 ```
 
-```bash
-yarn run test
+```sh
+$ yarn run test
 ```
 
 ## Linting and formatting
@@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and
 
 To lint:
 
-```bash
-yarn lint
+```sh
+$ yarn lint
 ```
 
 To format and fix all lint issues automatically:
 
-```bash
-yarn fix
+```sh
+$ yarn fix
 ```
 
 ## Publishing and releases
diff --git a/README.md b/README.md
index 824c2472..6ccba755 100644
--- a/README.md
+++ b/README.md
@@ -436,3 +436,7 @@ The following runtimes are supported:
 Note that React Native is not supported at this time.
 
 If you are interested in other runtime environments, please open or upvote an issue on GitHub.
+
+## Contributing
+
+See [the contributing documentation](./CONTRIBUTING.md).
diff --git a/package.json b/package.json
index 940a865e..e3b67db5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@anthropic-ai/sdk",
-  "version": "0.27.3",
+  "version": "0.28.0",
   "description": "The official TypeScript library for the Anthropic API",
   "author": "Anthropic <support@anthropic.com>",
   "types": "dist/index.d.ts",
@@ -41,6 +41,7 @@
     "eslint": "^8.49.0",
     "eslint-plugin-prettier": "^5.0.1",
     "eslint-plugin-unused-imports": "^3.0.0",
+    "iconv-lite": "^0.6.3",
     "jest": "^29.4.0",
     "prettier": "^3.0.0",
     "ts-jest": "^29.1.0",
diff --git a/packages/bedrock-sdk/CHANGELOG.md b/packages/bedrock-sdk/CHANGELOG.md
index d1a6ac21..0ee2655a 100644
--- a/packages/bedrock-sdk/CHANGELOG.md
+++ b/packages/bedrock-sdk/CHANGELOG.md
@@ -1,5 +1,13 @@
 # Changelog
 
+## 0.10.3 (2024-10-04)
+
+Full Changelog: [bedrock-sdk-v0.10.2...bedrock-sdk-v0.10.3](https://github.com/anthropics/anthropic-sdk-typescript/compare/bedrock-sdk-v0.10.2...bedrock-sdk-v0.10.3)
+
+### Chores
+
+* better object fallback behaviour for casting errors ([#526](https://github.com/anthropics/anthropic-sdk-typescript/issues/526)) ([4ffb2e4](https://github.com/anthropics/anthropic-sdk-typescript/commit/4ffb2e4e1f5fef3ae58d9f4c99a63e75dd459c5b))
+
 ## 0.10.2 (2024-07-29)
 
 Full Changelog: [bedrock-sdk-v0.10.1...bedrock-sdk-v0.10.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/bedrock-sdk-v0.10.1...bedrock-sdk-v0.10.2)
diff --git a/packages/bedrock-sdk/package.json b/packages/bedrock-sdk/package.json
index 140f7151..50bfe1ed 100644
--- a/packages/bedrock-sdk/package.json
+++ b/packages/bedrock-sdk/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@anthropic-ai/bedrock-sdk",
-  "version": "0.10.2",
+  "version": "0.10.3",
   "description": "The official TypeScript library for the Anthropic Bedrock API",
   "author": "Anthropic <support@anthropic.com>",
   "types": "dist/index.d.ts",
diff --git a/packages/bedrock-sdk/yarn.lock b/packages/bedrock-sdk/yarn.lock
index b642a4ff..2593fcb6 100644
--- a/packages/bedrock-sdk/yarn.lock
+++ b/packages/bedrock-sdk/yarn.lock
@@ -17,7 +17,7 @@
 
 "@anthropic-ai/sdk@file:../../dist":
   # x-release-please-start-version
-  version "0.27.3"
+  version "0.28.0"
   # x-release-please-end-version
   dependencies:
     "@types/node" "^18.11.18"
diff --git a/packages/vertex-sdk/CHANGELOG.md b/packages/vertex-sdk/CHANGELOG.md
index e312f5b6..961ab4ea 100644
--- a/packages/vertex-sdk/CHANGELOG.md
+++ b/packages/vertex-sdk/CHANGELOG.md
@@ -1,5 +1,13 @@
 # Changelog
 
+## 0.4.2 (2024-10-04)
+
+Full Changelog: [vertex-sdk-v0.4.1...vertex-sdk-v0.4.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.4.1...vertex-sdk-v0.4.2)
+
+### Chores
+
+* better object fallback behaviour for casting errors ([#526](https://github.com/anthropics/anthropic-sdk-typescript/issues/526)) ([4ffb2e4](https://github.com/anthropics/anthropic-sdk-typescript/commit/4ffb2e4e1f5fef3ae58d9f4c99a63e75dd459c5b))
+
 ## 0.4.1 (2024-07-29)
 
 Full Changelog: [vertex-sdk-v0.4.0...vertex-sdk-v0.4.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.4.0...vertex-sdk-v0.4.1)
diff --git a/packages/vertex-sdk/package.json b/packages/vertex-sdk/package.json
index 6e3c3c53..99817912 100644
--- a/packages/vertex-sdk/package.json
+++ b/packages/vertex-sdk/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@anthropic-ai/vertex-sdk",
-  "version": "0.4.1",
+  "version": "0.4.2",
   "description": "The official TypeScript library for the Anthropic Vertex API",
   "author": "Anthropic <support@anthropic.com>",
   "types": "dist/index.d.ts",
diff --git a/packages/vertex-sdk/yarn.lock b/packages/vertex-sdk/yarn.lock
index 8aac176d..e405f5e3 100644
--- a/packages/vertex-sdk/yarn.lock
+++ b/packages/vertex-sdk/yarn.lock
@@ -17,7 +17,7 @@
 
 "@anthropic-ai/sdk@file:../../dist":
   # x-release-please-start-version
-  version "0.27.3"
+  version "0.28.0"
   # x-release-please-end-version
   dependencies:
     "@types/node" "^18.11.18"
diff --git a/src/_shims/node-types.d.ts b/src/_shims/node-types.d.ts
index b31698f7..c159e5fa 100644
--- a/src/_shims/node-types.d.ts
+++ b/src/_shims/node-types.d.ts
@@ -7,7 +7,7 @@ import * as fd from 'formdata-node';
 export { type Agent } from 'node:http';
 export { type Readable } from 'node:stream';
 export { type ReadStream as FsReadStream } from 'node:fs';
-export { ReadableStream } from 'web-streams-polyfill';
+export { ReadableStream } from 'node:stream/web';
 
 export const fetch: typeof nf.default;
 
diff --git a/src/core.ts b/src/core.ts
index 720de46c..ae72e081 100644
--- a/src/core.ts
+++ b/src/core.ts
@@ -288,7 +288,10 @@ export abstract class APIClient {
     return null;
   }
 
-  buildRequest<Req>(options: FinalRequestOptions<Req>): { req: RequestInit; url: string; timeout: number } {
+  buildRequest<Req>(
+    options: FinalRequestOptions<Req>,
+    { retryCount = 0 }: { retryCount?: number } = {},
+  ): { req: RequestInit; url: string; timeout: number } {
     const { method, path, query, headers: headers = {} } = options;
 
     const body =
@@ -320,7 +323,7 @@ export abstract class APIClient {
       headers[this.idempotencyHeader] = options.idempotencyKey;
     }
 
-    const reqHeaders = this.buildHeaders({ options, headers, contentLength });
+    const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
 
     const req: RequestInit = {
       method,
@@ -339,10 +342,12 @@ export abstract class APIClient {
     options,
     headers,
     contentLength,
+    retryCount,
   }: {
     options: FinalRequestOptions;
     headers: Record<string, string | null | undefined>;
     contentLength: string | null | undefined;
+    retryCount: number;
   }): Record<string, string> {
     const reqHeaders: Record<string, string> = {};
     if (contentLength) {
@@ -358,6 +363,12 @@ export abstract class APIClient {
       delete reqHeaders['content-type'];
     }
 
+    // Don't set the retry count header if it was already set or removed by the caller. We check `headers`,
+    // which can contain nulls, instead of `reqHeaders` to account for the removal case.
+    if (getHeader(headers, 'x-stainless-retry-count') === undefined) {
+      reqHeaders['x-stainless-retry-count'] = String(retryCount);
+    }
+
     this.validateHeaders(reqHeaders, headers);
 
     return reqHeaders;
@@ -409,13 +420,14 @@ export abstract class APIClient {
     retriesRemaining: number | null,
   ): Promise<APIResponseProps> {
     const options = await optionsInput;
+    const maxRetries = options.maxRetries ?? this.maxRetries;
     if (retriesRemaining == null) {
-      retriesRemaining = options.maxRetries ?? this.maxRetries;
+      retriesRemaining = maxRetries;
     }
 
     await this.prepareOptions(options);
 
-    const { req, url, timeout } = this.buildRequest(options);
+    const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
 
     await this.prepareRequest(req, { url, options });
 
@@ -994,7 +1006,12 @@ const validatePositiveInteger = (name: string, n: unknown): number => {
 
 export const castToError = (err: any): Error => {
   if (err instanceof Error) return err;
-  return new Error(err);
+  if (typeof err === 'object' && err !== null) {
+    try {
+      return new Error(JSON.stringify(err));
+    } catch {}
+  }
+  return new Error(String(err));
 };
 
 export const ensurePresent = <T>(value: T | null | undefined): T => {
@@ -1131,7 +1148,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => {
   return typeof headers?.get === 'function';
 };
 
-export const getRequiredHeader = (headers: HeadersLike, header: string): string => {
+export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => {
+  const foundHeader = getHeader(headers, header);
+  if (foundHeader === undefined) {
+    throw new Error(`Could not find ${header} header`);
+  }
+  return foundHeader;
+};
+
+export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => {
   const lowerCasedHeader = header.toLowerCase();
   if (isHeadersProtocol(headers)) {
     // to deal with the case where the header looks like Stainless-Event-Id
@@ -1157,7 +1182,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string
     }
   }
 
-  throw new Error(`Could not find ${header} header`);
+  return undefined;
 };
 
 /**
diff --git a/src/resources/beta/prompt-caching/messages.ts b/src/resources/beta/prompt-caching/messages.ts
index 77f4d475..4668d11d 100644
--- a/src/resources/beta/prompt-caching/messages.ts
+++ b/src/resources/beta/prompt-caching/messages.ts
@@ -583,6 +583,14 @@ export namespace MessageCreateParams {
    */
   export interface ToolChoiceAuto {
     type: 'auto';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output at most one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   /**
@@ -590,6 +598,14 @@ export namespace MessageCreateParams {
    */
   export interface ToolChoiceAny {
     type: 'any';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output exactly one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   /**
@@ -602,6 +618,14 @@ export namespace MessageCreateParams {
     name: string;
 
     type: 'tool';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output exactly one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   export type MessageCreateParamsNonStreaming = PromptCachingMessagesAPI.MessageCreateParamsNonStreaming;
diff --git a/src/resources/messages.ts b/src/resources/messages.ts
index 2bcd89a1..9c5e46d7 100644
--- a/src/resources/messages.ts
+++ b/src/resources/messages.ts
@@ -690,6 +690,14 @@ export namespace MessageCreateParams {
    */
   export interface ToolChoiceAuto {
     type: 'auto';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output at most one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   /**
@@ -697,6 +705,14 @@ export namespace MessageCreateParams {
    */
   export interface ToolChoiceAny {
     type: 'any';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output exactly one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   /**
@@ -709,6 +725,14 @@ export namespace MessageCreateParams {
     name: string;
 
     type: 'tool';
+
+    /**
+     * Whether to disable parallel tool use.
+     *
+     * Defaults to `false`. If set to `true`, the model will output exactly one tool
+     * use.
+     */
+    disable_parallel_tool_use?: boolean;
   }
 
   export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
diff --git a/src/version.ts b/src/version.ts
index e741f3a2..3e76cc42 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.27.3'; // x-release-please-version
+export const VERSION = '0.28.0'; // x-release-please-version
diff --git a/tests/api-resources/beta/prompt-caching/messages.test.ts b/tests/api-resources/beta/prompt-caching/messages.test.ts
index e0e73f98..e7e2fada 100644
--- a/tests/api-resources/beta/prompt-caching/messages.test.ts
+++ b/tests/api-resources/beta/prompt-caching/messages.test.ts
@@ -34,7 +34,7 @@ describe('resource messages', () => {
       stream: false,
       system: [{ text: "Today's date is 2024-06-01.", type: 'text', cache_control: { type: 'ephemeral' } }],
       temperature: 1,
-      tool_choice: { type: 'auto' },
+      tool_choice: { type: 'auto', disable_parallel_tool_use: true },
       tools: [
         {
           input_schema: {
diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts
index 5592a7c4..870e9b53 100644
--- a/tests/api-resources/messages.test.ts
+++ b/tests/api-resources/messages.test.ts
@@ -34,7 +34,7 @@ describe('resource messages', () => {
       stream: false,
       system: [{ text: "Today's date is 2024-06-01.", type: 'text' }],
       temperature: 1,
-      tool_choice: { type: 'auto' },
+      tool_choice: { type: 'auto', disable_parallel_tool_use: true },
       tools: [
         {
           input_schema: {
diff --git a/tests/index.test.ts b/tests/index.test.ts
index c70ebad7..9de818c3 100644
--- a/tests/index.test.ts
+++ b/tests/index.test.ts
@@ -247,6 +247,89 @@ describe('retries', () => {
     expect(count).toEqual(3);
   });
 
+  test('retry count header', async () => {
+    let count = 0;
+    let capturedRequest: RequestInit | undefined;
+    const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise<Response> => {
+      count++;
+      if (count <= 2) {
+        return new Response(undefined, {
+          status: 429,
+          headers: {
+            'Retry-After': '0.1',
+          },
+        });
+      }
+      capturedRequest = init;
+      return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
+    };
+
+    const client = new Anthropic({ apiKey: 'my-anthropic-api-key', fetch: testFetch, maxRetries: 4 });
+
+    expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
+
+    expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toEqual('2');
+    expect(count).toEqual(3);
+  });
+
+  test('omit retry count header', async () => {
+    let count = 0;
+    let capturedRequest: RequestInit | undefined;
+    const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise<Response> => {
+      count++;
+      if (count <= 2) {
+        return new Response(undefined, {
+          status: 429,
+          headers: {
+            'Retry-After': '0.1',
+          },
+        });
+      }
+      capturedRequest = init;
+      return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
+    };
+    const client = new Anthropic({ apiKey: 'my-anthropic-api-key', fetch: testFetch, maxRetries: 4 });
+
+    expect(
+      await client.request({
+        path: '/foo',
+        method: 'get',
+        headers: { 'X-Stainless-Retry-Count': null },
+      }),
+    ).toEqual({ a: 1 });
+
+    expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count');
+  });
+
+  test('overwrite retry count header', async () => {
+    let count = 0;
+    let capturedRequest: RequestInit | undefined;
+    const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise<Response> => {
+      count++;
+      if (count <= 2) {
+        return new Response(undefined, {
+          status: 429,
+          headers: {
+            'Retry-After': '0.1',
+          },
+        });
+      }
+      capturedRequest = init;
+      return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
+    };
+    const client = new Anthropic({ apiKey: 'my-anthropic-api-key', fetch: testFetch, maxRetries: 4 });
+
+    expect(
+      await client.request({
+        path: '/foo',
+        method: 'get',
+        headers: { 'X-Stainless-Retry-Count': '42' },
+      }),
+    ).toEqual({ a: 1 });
+
+    expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toBe('42');
+  });
+
   test('retry on 429 with retry-after', async () => {
     let count = 0;
     const testFetch = async (url: RequestInfo, { signal }: RequestInit = {}): Promise<Response> => {
diff --git a/yarn.lock b/yarn.lock
index 0f17a273..10ebd6d6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1959,6 +1959,13 @@ humanize-ms@^1.2.1:
   dependencies:
     ms "^2.0.0"
 
+iconv-lite@^0.6.3:
+  version "0.6.3"
+  resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
+  integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
+  dependencies:
+    safer-buffer ">= 2.1.2 < 3.0.0"
+
 ignore@^5.2.0, ignore@^5.2.4:
   version "5.2.4"
   resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
@@ -3041,6 +3048,11 @@ safe-buffer@~5.2.0:
   resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
   integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
 
+"safer-buffer@>= 2.1.2 < 3.0.0":
+  version "2.1.2"
+  resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+  integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
+
 semver@^6.3.0, semver@^6.3.1:
   version "6.3.1"
   resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"