Skip to main content
GET
/
batch-predictions
/
{batch_prediction_id}
/
results
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
for batch_prediction in client.batch_predictions.retrieve_results(
    "batch_prediction_id",
):
  print(batch_prediction)
"{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_001\",\"status\":\"succeeded\",\"output\":{\"project_name\":\"Alpha Tower\",\"sheet_title\":\"Floor Plan\",\"revision\":\"R3\"},\"error\":null}\n{\"object\":\"batch_prediction.result\",\"batch_id\":\"bpred_abc123\",\"custom_id\":\"drawing_002\",\"status\":\"errored\",\"output\":null,\"error\":{\"type\":\"https://api.datagrid.com/errors/prediction_failed\",\"title\":\"Prediction Failed\",\"status\":422,\"detail\":\"The model returned an invalid response.\"}}\n"

Documentation Index

Fetch the complete documentation index at: https://developers.datagrid.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

batch_prediction_id
string
required

The id of the batch prediction whose results should be streamed.

Response

Batch prediction result stream

One NDJSON result line for a submitted batch item.

object
enum<string>
required

The object type, which is always batch_prediction.result.

Available options:
batch_prediction.result
batch_id
string
required

The batch prediction id.

custom_id
string
required

The caller-defined item id from the create request.

status
enum<string>
required

Terminal status for an individual result line.

Available options:
succeeded,
errored,
canceled,
expired
output
object
required

The model output when status is succeeded; otherwise null.

error
object
required

Problem details when status is errored, canceled, or expired; otherwise null.