OpenAI, Anthropic and Google Gen AI SDKs
Official Python clients for hosted models (GPT, Claude, Gemini).
Easy
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
msg = client.messages.create(model="claude-sonnet-5-5", max_tokens=300,
messages=[{"role": "user", "content": "Explain a Zener diode in one paragraph."}])
print(msg.content[0].text)
Keep API keys in environment variables, never in code.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.