agents.price-config.upsert ​
Create or replace an organisation-specific model price override
Upsert an org-specific price override for a model.
Retires any existing active row for the same org+model before inserting the new one, preserving the full price history as an audit trail.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/price-configs | Create or replace an org-specific model price override |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | string | Yes | — | — |
model_name | string | Yes | — | — |
price_per_1m_prompt_usd | float | No | — | — |
price_per_1m_completion_usd | float | No | — | — |
price_per_1m_cache_read_usd | float | No | — | — |
price_per_1m_cache_write_usd | float | No | — | — |
price_per_1m_reasoning_usd | float | No | — | — |
unit | string | No | — | — |
price_per_unit_usd | float | No | — | — |
model_family | string | No | — | — |
effective_from | string | No | — | — |
context_window_tokens | integer | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | string | No | — | — |
failure_reason | string | No | — | — |
model_name | json | No | — | — |
upserted | json | No | — | — |
organization_uuid | json | No | — | — |
price_per_1m_prompt_usd | json | No | — | — |
price_per_1m_completion_usd | json | No | — | — |
price_per_1m_cache_read_usd | json | No | — | — |
price_per_1m_cache_write_usd | json | No | — | — |
price_per_1m_reasoning_usd | json | No | — | — |
unit | json | No | — | — |
price_per_unit_usd | json | No | — | — |
model_family | json | No | — | — |
effective_from | json | No | — | — |
context_window_tokens | json | 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.price-config.upsert",
"initial_data": {
"organization_uuid": "value",
"model_name": "value"
}
}