import requests API_URL = "https://api-inference.huggingface.co/models/your-username/your-model-name" headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_TOKEN"} def query(payload): response = requests.post(API_URL, headers=headers, json=payload) return response.json() data = query({"inputs": "your input text"}) print(data)