Track and monitor your Together AI API requests with Keywords AI logging
import requests url = "https://api.keywordsai.co/api/request-logs/create/" payload = { "model": "meta-llama/Llama-3-8b-chat-hf", "prompt_messages": [ { "role": "user", "content": "Explain machine learning in simple terms" } ], "completion_message": { "role": "assistant", "content": "Machine learning is like teaching computers to learn patterns from data..." }, "cost": 0.0005, "generation_time": 2.1, "customer_params": { "customer_identifier": "user_303" } } headers = { "Authorization": "Bearer YOUR_KEYWORDS_AI_API_KEY", "Content-Type": "application/json" } response = requests.post(url, headers=headers, json=payload)
Was this page helpful?