You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-17Lines changed: 46 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -454,33 +454,62 @@ const client = new Anthropic({
454
454
Note that if given a `ANTHROPIC_LOG=debug` environment variable, this library will log all requests and responses automatically.
455
455
This is intended for debugging purposes only and may change in the future without notice.
456
456
457
-
### Configuring an HTTP(S) Agent (e.g., for proxies)
457
+
### Fetch options
458
458
459
-
By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
459
+
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
460
460
461
-
If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
461
+
```ts
462
+
importAnthropicfrom'@anthropic-ai/sdk';
463
+
464
+
const client =newAnthropic({
465
+
fetchOptions: {
466
+
// `RequestInit` options
467
+
},
468
+
});
469
+
```
470
+
471
+
#### Configuring proxies
472
+
473
+
To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
0 commit comments