AiBatchCreateRequest ai.batch-create-request@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- ai
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/ai/batch-create-request.v1.json
ai.batch-create-request@1: the body of POST /api/v1/batches on OpenVibe.AI (capability ai.batches.create). One batch of many prompts: the answers come later, and the batch is billed at half the retail price. Errors are problem+json: 422 input.invalid (no items, an empty prompt, a prompt over 20000 characters, a deadline outside 1 to 72 hours), 422 batch.too_large (more prompts than the service's cap), 403 batch.no_payer (the token names no account to pay), 403 batch.no_grant (a service without the ai.batches.create grant).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
items | array of one of | yes | The prompts of the batch, in order. Each item is a prompt, or an object with a prompt and the model it wants. |
|
model | string | The model the whole batch asks for, when no item names one. | ||
deadline_hours | integer | How long the batch may take, in hours (1 to 72). Omitted: the service's own default (24 hours). A prompt that reaches the deadline without cheap capacity expires and is never charged. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: prompts
{
"items": [
"one prompt",
{
"prompt": "another prompt",
"model": "gpt-4o-mini"
}
]
}Valid: with-a-deadline
{
"items": [
"one prompt"
],
"model": "gpt-4o-mini",
"deadline_hours": 24
}Rejected: a-deadline-out-of-range
{
"items": [
"one prompt"
],
"deadline_hours": 100
}Rejected: empty-prompt
{
"items": [
""
]
}Rejected: no-items
{
"items": []
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ai.batch-create-request@1', value); // { valid, errors: [{ path, message }] }