API reference
Create custom pricing
Use your API key to create a custom pricing row for an LLM model or non-LLM metric.
Creates a custom pricing row. This endpoint accepts your API key and records an audit log entry.
For LLM pricing, send
Authentication
curl -X POST https://api.pylva.com/api/v1/custom-pricing \
-H "X-Pylva-Key: $PYLVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":null,"model":null,"metric":"search_requests","price_per_unit_usd":0.01,"effective_from":"2026-06-11T00:00:00.000Z","source":"builder_manual"}'
Request
{
"provider": null,
"model": null,
"metric": "search_requests",
"price_per_unit_usd": 0.01,
"effective_from": "2026-06-11T00:00:00.000Z",
"source": "builder_manual",
"notes": "Search API list price."
}
provider and model and leave metric null:
{
"provider": "openai",
"model": "gpt-4o-mini",
"metric": null,
"price_per_unit_usd": 0,
"input_per_1m_usd": 0.15,
"output_per_1m_usd": 0.6,
"effective_from": "2026-06-11T00:00:00.000Z",
"source": "builder_manual"
}
Response
{
"id": "00000000-0000-0000-0000-000000000000"
}
Notes
- Set either
(provider + model)ormetric, not both. - Duplicate effective pricing rows return a validation error.
- Pricing changes can affect margin reports and billing workflows.