Zack Saadioui
8/26/2024
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import requests API_KEY = 'YOUR_API_KEY' def call_claude(prompt): response = requests.post( "https://api.anthropic.com/v1/messages", headers={ "content-type": "application/json", "x-api-key": API_KEY }, json={ "model": "claude-3-5-sonnet-20240620", "messages": [{"role": "user", "content": prompt}] } ) return response.json() input_prompt = "Generate a marketing email about our latest product." output = call_claude(input_prompt) print(output)
Copyright © Arsturn 2024