Receive real-time notifications when events happen in your account. No polling required.
Subscribe to the events you care about:
Batch processing job finished. Access results and handle any errors.
Batch processing job failed. Review error details and retry if needed.
New fine-tuning job started. Track progress and estimated completion.
Fine-tuning completed successfully. Your model is ready to use.
Fine-tuning failed. Check error logs and training data.
Usage threshold hit. Set up alerts to monitor costs.
Set up an HTTPS endpoint on your server to receive POST requests. Must return 2xx status within 30 seconds.
Go to Dashboard → Settings → Webhooks and add your endpoint URL. Select which events to receive.
Validate incoming webhooks using the signing secret to ensure they're from MythicDot.AI.
All webhook events follow the same structure:
{
"id": "evt_abc123xyz789",
"type": "batch.completed",
"created": 1706140800,
"data": {
"object": {
"id": "batch_abc123",
"status": "completed",
"request_counts": {
"total": 1000,
"completed": 998,
"failed": 2
},
"output_file_id": "file_xyz789"
}
}
}
from flask import Flask, request import hmac import hashlib app = Flask(__name__) WEBHOOK_SECRET = "whsec_..." @app.route("/webhook", methods=["POST"]) def webhook(): # Verify signature signature = request.headers.get("X-MythicDot-Signature") payload = request.get_data() expected = hmac.new( WEBHOOK_SECRET.encode(), payload, hashlib.sha256 ).hexdigest() if not hmac.compare_digest(signature, expected): return "Invalid signature", 401 # Process the event event = request.json event_type = event["type"] if event_type == "batch.completed": batch_id = event["data"]["object"]["id"] print(f"Batch {batch_id} completed!") # Download and process results... elif event_type == "fine_tuning.job.succeeded": model_id = event["data"]["object"]["fine_tuned_model"] print(f"Model ready: {model_id}") return "OK", 200
If your endpoint doesn't respond with 2xx, we'll retry with exponential backoff:
| Attempt | Delay | Time from Event |
|---|---|---|
| 1 (initial) | Immediate | 0 min |
| 2 | 5 minutes | 5 min |
| 3 | 30 minutes | 35 min |
| 4 | 2 hours | 2.5 hours |
| 5 (final) | 8 hours | ~10 hours |
Use the Dashboard → Webhooks → Logs to see delivery attempts, payloads, and response codes. You can also manually retry failed deliveries.