A successful response is easy to document and rarely the source of a support call. The calls come from the other states: the corpus had nothing, the input was malformed, the limit was reached, half the batch failed. If a consumer cannot tell those apart programmatically, every one of them becomes an email.
| State | What it means | What the consumer should do |
|---|---|---|
| Answered | A response grounded in retrieved passages | Render it with the citations attached |
| Abstained | The corpus holds no passage above the threshold | Show the gap; do not retry the same query |
| Invalid | A field failed validation | Fix the input; the field is named in the payload |
| Limited | A rate or quota limit was reached | Back off for the stated interval |
| Partial | Some items succeeded | Process the successes; queue the rest |
| Unavailable | The service cannot respond | Retry if safe; otherwise degrade |
The error payload names the field, the reason and whether a retry is safe. “Error 500” is not a contract; it is an invitation to guess. The distinction between an abstention and a failure matters most, because an abstention is a legitimate answer that a UI should display rather than an incident to be logged.
The rest of the contract
- Authentication through the client’s identity provider, or a scoped key in a secret store
- Latency stated as a typical figure and a tail, with the conditions that change it
- Idempotency keys for any call that writes
- A version in the path, and both versions running during migration
- A deprecation date and a migration note, agreed in writing
The specification ships as a machine-readable document alongside the prose, so a consumer can generate a client and see the failure states in the schema. Contract tests run against both, which is how the document stays true after the third change.
There is no public API to try, and no key to request. The interface described here is delivered inside an engagement, against a named consumer and its data.