Read the receipt of one request — its model, tokens and cost in DA — and send feedback on an answer.
Every model answer carries an X-Generation-Id header, and the same handle in its body's id. It is the receipt handle: pass it to these routes to read what the request cost and what it kept.
| Method | Path | Key | Does |
|---|---|---|---|
GET | /v1/generation?id=… | API key | the receipt of one request |
GET | /v1/generation/content?id=… | API key | what the request made and kept, where kept |
POST | /v1/generation/feedback | management key | feedback on one answer |
All three are free. id is the receipt handle, or the request's own id. You read only your own account's receipts; any other id is a 404.
curl "https://opendunes.com/v1/generation?id=gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG" \
-H "Authorization: Bearer $OPENDUNES_API_KEY"{
"data": {
"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG",
"created_at": "2026-09-24T09:12:03+00:00",
"model": "anthropic/claude-sonnet-5",
"streamed": true,
"cancelled": false,
"finish_reason": null,
"tokens_prompt": 18,
"tokens_completion": 42,
"native_tokens_prompt": 18,
"native_tokens_completion": 42,
"total_cost": 0.2574,
"usage": 0.2574,
"latency": 1840,
"generation_time": 1840,
"is_byok": false
}
}| Field | Description |
|---|---|
model | The model that served the request |
streamed · cancelled | Whether it streamed, and whether it was cut before the end |
tokens_prompt · tokens_completion | Input and output tokens |
total_cost · usage | What the request was charged, in DA |
latency · generation_time | How long the request took, in milliseconds |
A request that made a file — a picture, a voice, a clip — and kept it names it here. Text makes no file, so a text request has no kept content: its answer is in the answer you received.
curl "https://opendunes.com/v1/generation/content?id=gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG" \
-H "Authorization: Bearer $OPENDUNES_API_KEY"{
"data": {
"input": null,
"output": {
"completion": null,
"reasoning": null,
"files": ["a2d16fe6-c19c-4f85-8759-937da517410d"]
},
"error": null
}
}Each id opens with GET /v1/files/{id}/content. A request that kept nothing answers 404.
curl https://opendunes.com/v1/generation/feedback \
-H "Authorization: Bearer $OPENDUNES_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"generation_id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG",
"category": "incorrect_response",
"comment": "The model repeated the same paragraph three times."
}'category is one of latency, incoherence, incorrect_response, formatting, billing, api_error, other; comment is optional, up to 1 000 characters. The answer is { "data": { "success": true } }.