Track and monitor your OpenAI API requests with Keywords AI logging
import requests url = "https://api.keywordsai.co/api/request-logs/create/" payload = { "model": "gpt-4o", "prompt_messages": [ { "role": "user", "content": "Hello, how are you?" } ], "completion_message": { "role": "assistant", "content": "I'm doing well, thank you for asking!" }, "cost": 0.0015, "generation_time": 2.3, "customer_params": { "customer_identifier": "user_123" } } headers = { "Authorization": "Bearer YOUR_KEYWORDS_AI_API_KEY", "Content-Type": "application/json" } response = requests.post(url, headers=headers, json=payload)
Was this page helpful?