Skip to main content
One customer message can answer several questions for your application. This example combines D1’s three question types to help route a support request.

Define the questions

Save this body as prediction.json:
prediction.json

Send one request

Set D1_API_URL and D1_API_KEY as shown in the quickstart. Generate a fresh key once, then keep it with this request for any retries.

Use the answers

Answers arrive in the same order and retain the IDs you supplied. A score can be fractional. Choose your own routing thresholds using representative examples; model scores do not establish probability calibration.
Staging answers are simulated. Use them to test request handling and routing code, then evaluate a real model before making decisions from its scores.
See Create a prediction for the full response schema, or reliable retries to handle an interrupted request.