Documentation

Webhooks

Deep Infra supports webhooks to deliver inference results and notify about inference errors. Webhook argument is optional and if you do not provide one, Deep Infra API servers will keep the request open and return you the result in the HTTP response. If you do provide a webhook the API server will respond with a "queued" status and deliver actual result in the webhook. Delivered response will contain inference result, cost estimate and runtime and/or an error in a JSON body.

{
    "request_id": "R7X9fdlIaF5GlVisBAi5xR3E",
    "inference_status": {
        "status": "succeeded",
        "runtime_ms": 228,
        "cost": 0.0001140000022132881
    },
    "results": {...}
}

Errors will have the following format:

{
    "request_id": "RHNShFanUP5ExA8rzgyDWH88",
    "inference_status": {
        "status": "failed",
        "runtime_ms": 0,
        "cost": 0.0
    }
}

We will make a few attempts if your webhook endpoint returns 400+ status.