Create a Claude api key
- Navigate to here and Refer Here for the docs
Creating an open ai api key
- Navigate to here and create an api key
setting up the project with api keys
- Execute the following
mkdir openai_n_claude_api_samples
cd openai_n_claude_api_samples
uv init .
uv add python-dotenv
Interacting with models
- We have two libraries generally
- low level calls
- agent framework
Interacting with claude
- Package name is anthropic
uv add anthropic
-
Refer Here for the library docs
-
anthropic expects us to use client object
- Create a client object
- now generate response using
client.messages.create
Interacting with openai
- Package name is openai
uv add openai
- Create a client object
- now generate response using
client.responses.create
