Skip to main content

Log Nebius requests

Monitor your Nebius API calls by logging requests and responses asynchronously. Track metrics like cost, duration, and performance for Nebius cloud AI services.
import requests

url = "https://api.keywordsai.co/api/request-logs/create/"
payload = {
    "model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
    "prompt_messages": [
        {
            "role": "user",
            "content": "Explain the benefits of cloud computing"
        }
    ],
    "completion_message": {
        "role": "assistant",
        "content": "Cloud computing offers scalability, cost-effectiveness, and flexibility..."
    },
    "cost": 0.0004,
    "generation_time": 2.0,
    "customer_params": {
        "customer_identifier": "user_909"
    }
}
headers = {
    "Authorization": "Bearer YOUR_KEYWORDS_AI_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=payload)

Get Started with Logging

Learn how to set up comprehensive logging for all your LLM requests
I