ExchangeImageResult exchange.image-result@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- exchange
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-025
- Schema
https://openvibe.network/contracts/exchange/image-result.v1.json
Exchange API platform ExchangeImageResult response. Private account data is available only to its owner.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
results | array of object | yes | ||
results[].title | string | yes | ||
results[].url | string | yes |
| |
results[].snippet | string | yes | ||
results[].engine | string | yes | ||
results[].published | string | null | yes | ||
results[].license | string | null | yes | ||
results[].author | string | null | yes | ||
results[].source_page | string | null | yes | ||
results[].attribution | string | null | yes | ||
results[].thumbnail | string | null | |||
receipt | object | yes |
| |
receipt.engine | string | yes | ||
receipt.cost_usd | number | yes |
| |
receipt.time_ms | number | yes |
| |
receipt.attempts | array of object | Ordered routing attempts with safe reason codes; no provider error bodies or credentials. |
| |
receipt.attempts[].provider | string | yes |
| |
receipt.attempts[].engine | string | yes |
| |
receipt.attempts[].model | string | null |
| ||
receipt.attempts[].status | enum | yes |
| |
receipt.attempts[].reason | enum |
| ||
receipt.attempts[].time_ms | number | yes |
| |
receipt.attempts[].cost_usd | number | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: fallback
{
"results": [],
"receipt": {
"engine": "openverse",
"cost_usd": 0,
"time_ms": 5,
"attempts": [
{
"provider": "brave",
"engine": "brave",
"status": "error",
"reason": "timeout",
"time_ms": 15000,
"cost_usd": 0.005
},
{
"provider": "openverse",
"engine": "openverse",
"status": "ok",
"time_ms": 20,
"cost_usd": 0
}
]
}
}Valid: platform
{
"results": [],
"receipt": {
"engine": "openverse",
"cost_usd": 0,
"time_ms": 5
}
}Rejected: platform
{}Rejected: unsafe-reason
{
"results": [],
"receipt": {
"engine": "openverse",
"cost_usd": 0,
"time_ms": 5,
"attempts": [
{
"provider": "brave",
"engine": "brave",
"status": "error",
"reason": "raw upstream error",
"time_ms": 15000,
"cost_usd": 0.005
},
{
"provider": "openverse",
"engine": "openverse",
"status": "ok",
"time_ms": 20,
"cost_usd": 0
}
]
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('exchange.image-result@1', value); // { valid, errors: [{ path, message }] }