@@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md).
20
20
``` js
21
21
import Anthropic from ' @anthropic-ai/sdk' ;
22
22
23
- const anthropic = new Anthropic ({
23
+ const client = new Anthropic ({
24
24
apiKey: process .env [' ANTHROPIC_API_KEY' ], // This is the default and can be omitted
25
25
});
26
26
@@ -44,7 +44,7 @@ We provide support for streaming responses using Server Sent Events (SSE).
44
44
``` ts
45
45
import Anthropic from ' @anthropic-ai/sdk' ;
46
46
47
- const anthropic = new Anthropic ();
47
+ const client = new Anthropic ();
48
48
49
49
const stream = await anthropic .messages .create ({
50
50
max_tokens: 1024 ,
@@ -68,7 +68,7 @@ This library includes TypeScript definitions for all request params and response
68
68
``` ts
69
69
import Anthropic from ' @anthropic-ai/sdk' ;
70
70
71
- const anthropic = new Anthropic ({
71
+ const client = new Anthropic ({
72
72
apiKey: process .env [' ANTHROPIC_API_KEY' ], // This is the default and can be omitted
73
73
});
74
74
@@ -193,7 +193,7 @@ You can use the `maxRetries` option to configure or disable this:
193
193
<!-- prettier-ignore -->
194
194
``` js
195
195
// Configure the default for all requests:
196
- const anthropic = new Anthropic ({
196
+ const client = new Anthropic ({
197
197
maxRetries: 0 , // default is 2
198
198
});
199
199
@@ -210,7 +210,7 @@ Requests time out after 10 minutes by default. You can configure this with a `ti
210
210
<!-- prettier-ignore -->
211
211
``` ts
212
212
// Configure the default for all requests:
213
- const anthropic = new Anthropic ({
213
+ const client = new Anthropic ({
214
214
timeout: 20 * 1000 , // 20 seconds (default is 10 minutes)
215
215
});
216
216
@@ -235,7 +235,7 @@ Be aware that doing so may result in incorrect types and other unexpected or und
235
235
``` ts
236
236
import Anthropic from ' @anthropic-ai/sdk' ;
237
237
238
- const anthropic = new Anthropic ();
238
+ const client = new Anthropic ();
239
239
240
240
const message = await anthropic .messages .create (
241
241
{
@@ -257,7 +257,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
257
257
258
258
<!-- prettier-ignore -->
259
259
``` ts
260
- const anthropic = new Anthropic ();
260
+ const client = new Anthropic ();
261
261
262
262
const response = await anthropic .messages
263
263
.create ({
@@ -376,7 +376,7 @@ import http from 'http';
376
376
import { HttpsProxyAgent } from ' https-proxy-agent' ;
377
377
378
378
// Configure the default for all requests:
379
- const anthropic = new Anthropic ({
379
+ const client = new Anthropic ({
380
380
httpAgent: new HttpsProxyAgent (process .env .PROXY_URL ),
381
381
});
382
382
0 commit comments