Light Logo
Models

Create a prediction

Create a prediction for the provided inputs against the latest version of a model. By default this endpoint handles requests asynchronously by creating a prediction and returning the created prediction without waiting for a response from the model. This endpoint can be made to wait for a response by passing a optional Prefer header with the wait time. This endpoint will then wait upto the wait time specified for a response from the model. If it receives one it will return the response otherwise the pending prediction is returned which can be polled for updates. If it receives one it will return the response otherwise the pending prediction is returned which can be polled for updates using get prediction endpoint.

POST
/models/{model_owner}/{model_name}/predictions
AuthorizationBearer <token>

In: header

Path Parameters

model_ownerModel Owner

The username of the user that owns the model.

model_nameModel Name

The name of the model.

Header Parameters

Validate-Input?Validate-Input

Enable early input validation against the model schema to catch invalid inputs before spinning up the hardware, adding slight latency, but avoiding unnecessary execution and cost.

Defaultfalse
Prefer?Prefer

Pass a wait time to tell the server how long to wait in seconds for a prediction response. e.g Prefer: wait=10 will wait for upto 10 seconds. Other preferences passed will be ignored which means Prefer: wait=10 and Prefer: respond-async, wait=10 are equivalent as the respond-async directive is ignored. If you notice that the endpoint returns before your specified wait time you may be being timed out by our server which will limit how long the endpoint will wait for a response.

inputInput

The input to pass to the model during prediction.

Empty Object

webhook?Webhook | null

Details about the webhook to post prediction updates to.

Response Body

curl -X POST "https://api.wrift.ai/v1/models/string/string/predictions" \  -H "Validate-Input: false" \  -H "Prefer: string" \  -H "Content-Type: application/json" \  -d '{    "input": {}  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "model": {
    "owner": "string",
    "name": "string",
    "version_number": 0
  },
  "created_at": "2019-08-24T14:15:22Z",
  "status": "pending",
  "updated_at": "2019-08-24T14:15:22Z",
  "setup_time": "string",
  "execution_time": "string",
  "error": {
    "source": "internal",
    "message": "string",
    "detail": null
  },
  "input": null,
  "output": null,
  "url": "string"
}
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "model": {
    "owner": "string",
    "name": "string",
    "version_number": 0
  },
  "created_at": "2019-08-24T14:15:22Z",
  "status": "pending",
  "updated_at": "2019-08-24T14:15:22Z",
  "setup_time": "string",
  "execution_time": "string",
  "error": {
    "source": "internal",
    "message": "string",
    "detail": null
  },
  "input": null,
  "output": null,
  "url": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}