diff --git a/README.md b/README.md index 807b01eb..e5d25135 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md). ```js import Anthropic from '@anthropic-ai/sdk'; -const anthropic = new Anthropic({ +const client = new Anthropic({ apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted }); @@ -44,7 +44,7 @@ We provide support for streaming responses using Server Sent Events (SSE). ```ts import Anthropic from '@anthropic-ai/sdk'; -const anthropic = new Anthropic(); +const client = new Anthropic(); const stream = await anthropic.messages.create({ max_tokens: 1024, @@ -68,7 +68,7 @@ This library includes TypeScript definitions for all request params and response ```ts import Anthropic from '@anthropic-ai/sdk'; -const anthropic = new Anthropic({ +const client = new Anthropic({ apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted }); @@ -193,7 +193,7 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const anthropic = new Anthropic({ +const client = new Anthropic({ maxRetries: 0, // default is 2 }); @@ -210,7 +210,7 @@ Requests time out after 10 minutes by default. You can configure this with a `ti ```ts // Configure the default for all requests: -const anthropic = new Anthropic({ +const client = new Anthropic({ timeout: 20 * 1000, // 20 seconds (default is 10 minutes) }); @@ -235,7 +235,7 @@ Be aware that doing so may result in incorrect types and other unexpected or und ```ts import Anthropic from '@anthropic-ai/sdk'; -const anthropic = new Anthropic(); +const client = new Anthropic(); const message = await anthropic.messages.create( { @@ -257,7 +257,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const anthropic = new Anthropic(); +const client = new Anthropic(); const response = await anthropic.messages .create({ @@ -376,7 +376,7 @@ import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: -const anthropic = new Anthropic({ +const client = new Anthropic({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), });