Skip to content

Commit 87aa378

Browse files
chore(docs): use environment variables for authentication in code snippets
1 parent d7ae1fc commit 87aa378

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ pip install anthropic[aiohttp]
9595
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
9696

9797
```python
98+
import os
9899
import asyncio
99100
from anthropic import DefaultAioHttpClient
100101
from anthropic import AsyncAnthropic
101102

102103

103104
async def main() -> None:
104105
async with AsyncAnthropic(
105-
api_key="my-anthropic-api-key",
106+
api_key=os.environ.get("ANTHROPIC_API_KEY"), # This is the default and can be omitted
106107
http_client=DefaultAioHttpClient(),
107108
) as client:
108109
message = await client.messages.create(

0 commit comments

Comments
 (0)