agents.model-capacity.acquire ​
Atomically reserve one agent model call against admitted RPM and TPM
Reserve one model request against session and provider rolling limits.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| INTERNAL | internal.invocation | Internal model-call capacity admission |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
session_uuid | string | Yes | — | — |
organization_uuid | string | Yes | — | — |
turn | integer | Yes | — | — |
requested_tokens | integer | Yes | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
permitted | boolean | Yes | — | — |
blocker_code | string | No | — | — |
retry_after_seconds | integer | No | — | — |
idempotent | boolean | No | — | — |
session_rpm_used | integer | No | — | — |
session_tpm_used | integer | No | — | — |
provider_rpm_used | integer | No | — | — |
provider_tpm_used | integer | No | — | — |
session_uuid | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | string | No | — | — |
failure_reason | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | run | — |
run | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | run | run | — |
run | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "agents.model-capacity.acquire",
"initial_data": {
"session_uuid": "value",
"organization_uuid": "value",
"turn": 123,
"requested_tokens": 123
}
}