Create a project model price
const url = 'http://localhost:8080/api/v1/projects/example/models';const options = { method: 'POST', headers: { cookie: 'cetra_session=<cetra_session>', 'Content-Type': 'application/json' }, body: '{"match_pattern":"example","model_name":"example","price_cache_read":1,"price_cache_write":1,"price_input":1,"price_output":1,"price_reasoning":1,"provider":"example","tiers":[{"min_input_tokens":1,"price_cache_read":1,"price_cache_write":1,"price_input":1,"price_output":1,"price_reasoning":1}],"valid_from":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/projects/example/models \ --header 'Content-Type: application/json' \ --cookie cetra_session=<cetra_session> \ --data '{ "match_pattern": "example", "model_name": "example", "price_cache_read": 1, "price_cache_write": 1, "price_input": 1, "price_output": 1, "price_reasoning": 1, "provider": "example", "tiers": [ { "min_input_tokens": 1, "price_cache_read": 1, "price_cache_write": 1, "price_input": 1, "price_output": 1, "price_reasoning": 1 } ], "valid_from": "2026-04-15T12:00:00Z" }'Project admins. API keys cannot call it. A PATCH replaces the whole row. A write that would leave a budgeted online rule without a price is 409.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Request Bodyrequired
Section titled “Request Bodyrequired”Body of POST /models and PATCH /models/{id}. A PATCH replaces the whole row: an absent
optional field becomes null (D-T-7).
object
Regular expression, 1–500 bytes. Absent or blank: exactly model_name.
Display name, 1–200 characters after trimming.
USD per 1M cache-read tokens.
USD per 1M cache-write tokens.
USD per 1M uncached input tokens, 0–1 000 000.
USD per 1M output tokens, 0–1 000 000.
USD per 1M reasoning tokens. Absent: the output price.
Provider, such as openai or gcp.vertex_ai. Absent or blank: any provider.
Up to 8 bands, by strictly increasing min_input_tokens.
One long-context band. A null price uses the row’s base price.
object
The band applies when the span’s input tokens (cache included) are at least this count.
USD per 1M cache-read tokens.
USD per 1M cache-write tokens.
USD per 1M uncached input tokens.
USD per 1M output tokens.
USD per 1M reasoning tokens.
Absent: the row applies at any time. JSON is RFC 3339.
Example generated
{ "match_pattern": "example", "model_name": "example", "price_cache_read": 1, "price_cache_write": 1, "price_input": 1, "price_output": 1, "price_reasoning": 1, "provider": "example", "tiers": [ { "min_input_tokens": 1, "price_cache_read": 1, "price_cache_write": 1, "price_input": 1, "price_output": 1, "price_reasoning": 1 } ], "valid_from": "2026-04-15T12:00:00Z"}Responses
Section titled “Responses”The created price.
A price row.
object
Creation time. Absent on built-in rows. JSON is RFC 3339.
Row id. Absent on built-in rows.
Regular expression matched against the span’s model, anchored and case-insensitive.
Display name.
USD per 1M cache-read tokens.
USD per 1M cache-write tokens.
USD per 1M uncached input tokens.
USD per 1M output tokens.
USD per 1M reasoning tokens. Absent: the output price.
When set, the row prices spans of this provider (or with none).
Who owns the row.
Long-context bands, by increasing min_input_tokens. Empty when none.
One long-context band. A null price uses the row’s base price.
object
The band applies when the span’s input tokens (cache included) are at least this count.
USD per 1M cache-read tokens.
USD per 1M cache-write tokens.
USD per 1M uncached input tokens.
USD per 1M output tokens.
USD per 1M reasoning tokens.
Last change. Absent on built-in rows. JSON is RFC 3339.
The row prices spans that started at or after this time. JSON is RFC 3339.
Example
{ "scope": "builtin"}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The request conflicts with the current state.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}