Create a decision task
POST this JSON body to /v1/inferences using your API base URL. Send Authorization: Bearer YOUR_API_KEY, Content-Type: application/json, and a unique Idempotency-Key header. This example asks all three question types about one shared state. The state and questions fields belong inside the input object, not at the request top level. Do not add an extra wrapper.
{
"model": "jev-1-13",
"endpoint": "decisions",
"provider": "seeapi",
"input": {
"state": "The customer asks to change a delivery address.",
"questions": {
"routing": {
"type": "choice",
"instructions": "Which queue should handle this request?",
"criteria": {
"billing": "Questions about charges, invoices, or refunds.",
"delivery": "Questions about delivery, tracking, or address changes."
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is the request?",
"criteria": [
"Can wait",
"Needs attention soon",
"Requires immediate attention"
]
},
"needs_support": {
"type": "noul",
"instructions": "Does the customer need help with an existing order?"
}
}
}
}For structured input, set input.state to a JSON object or array directly. Keep the same question definitions, adjusting instructions and criteria to your data. For example, input.state can be {"message":"Please change my delivery address.","order_status":"not_shipped"}. Send only one state value per request.
Query a task
Use the complete task ID returned by the creation request and the same API environment and API key. Query GET /v1/inferences/{task_id}, not the generation task endpoint.
For queued or processing, poll again with backoff. Stop polling at a terminal status. A succeeded task means evaluation completed, not that every answer is yes. Inspect the error code and message if the task fails.
export SEEAPI_API_BASE_URL='https://api.seeapi.com'
export SEEAPI_API_KEY='YOUR_API_KEY'
export SEEAPI_TASK_ID='task_xxx'
curl --request GET "$SEEAPI_API_BASE_URL/v1/inferences/$SEEAPI_TASK_ID" --header "Authorization: Bearer $SEEAPI_API_KEY"Query response — 200 OK
This is an illustrative completed response for the three questions in the request example. The task ID, answers, token counts and credits are examples, not guaranteed results or a fixed per-request price.
{
"id": "task_xxx",
"object": "inference",
"model": "jev-1-13",
"endpoint": "decisions",
"provider": "seeapi",
"status": "succeeded",
"consumed_credits": 0.022,
"input_tokens": 1300,
"output_tokens": 129,
"result": {
"type": "json",
"data": {
"answers": {
"routing": {
"type": "choice",
"choice": "delivery",
"confidence": 1,
"probabilities": {
"billing": 0,
"delivery": 1
}
},
"urgency": {
"type": "score",
"score": 0,
"confidence": 1,
"probabilities": {
"0": 1,
"1": 0,
"2": 0
},
"legend": {
"0": "Can wait",
"1": "Needs attention soon",
"2": "Requires immediate attention"
}
},
"needs_support": {
"type": "noul",
"noul": 0.99
}
}
}
},
"error": null
}Read the answers
Match answers to submitted question IDs. Do not rely on JSON object order.
noul is the probability of yes: 0.99 means 99%, not a boolean. Apply your own application policy if you need a yes/no cutoff.
choice returns the selected option name, confidence and probabilities for the options.
score uses the zero-based scale defined by criteria and may be fractional. Match probability keys to legend entries. Position 0 does not mean 0% probability.
Only fields relevant to each answer type are returned. Decisions do not automatically apply a moderation threshold or return a flagged verdict. Assessments can be wrong; review important decisions.
Credits and token usage
consumed_credits is the actual SeeAPI credit consumption after settlement, including any amount added to the outstanding balance. input_tokens and output_tokens report usage when available. All three fields are at the response top level, not inside the result data. Use the returned values; do not infer tokens from character count or treat the example credit amount as a fixed price.