import requests import json url = "https://api.keywordsai.co/api/v1/batches/" headers = { "Authorization": "Bearer YOUR_API_KEY", "X-Data-Keywordsai-Params": json.dumps({ "customer_identifier": "user123" }) } params = {"limit": 10} response = requests.get(url, headers=headers, params=params) print(response.json())
{ "object": "list", "data": [ { "id": "batch_abc123", "object": "batch", "endpoint": "/v1/chat/completions", "status": "completed", "created_at": 1711471533, "completed_at": 1711493163, "request_counts": { "total": 100, "completed": 95, "failed": 5 } }, { "id": "batch_def456", "object": "batch", "endpoint": "/v1/chat/completions", "status": "in_progress", "created_at": 1711475163, "request_counts": { "total": 50, "completed": 23, "failed": 0 } } ], "first_id": "batch_abc123", "last_id": "batch_def456", "has_more": false }
X-Data-Keywordsai-Params
-H "X-Data-Keywordsai-Params: {\"customer_identifier\": \"user123\"}"
Example
?limit=10
last_id
?after=batch_def456
Was this page helpful?