Get a prediction
Retrieve a prediction by its id.
In: header
Path Parameters
The ID of the prediction to get.
uuidResponse Body
from wriftai import Clientwriftai = Client()prediction = wriftai.predictions.get("497f6eca-6276-4993-bfeb-53cbbbba6f08")print(prediction.status){
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"model": {
"name": "kokoro-82m",
"owner": "hexgrad",
"version_number": 1
},
"created_at": "2024-06-12T14:22:31Z",
"status": "pending",
"updated_at": "2024-06-12T14:22:47Z",
"setup_time": "1.42",
"execution_time": "3.87",
"error": {
"message": "The model failed to load required weights.",
"source": "internal"
},
"metrics": {
"input_tokens": 42,
"output_tokens": 128
},
"input": {
"text": "Hello, welcome to WriftAI!"
},
"output": {
"audio": "https://wrift.ai/predictions/output.wav"
},
"stream": false
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Create a prediction POST
Create a prediction for the provided inputs against the specified 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 using the get prediction endpoint.
List predictions GET
Retrieve a paginated list of all predictions for the authenticated account. The predictions are sorted by creation time, newest to oldest.