Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Create an org model price

POST
/api/v1/orgs/{org}/models
curl --request POST \
--url http://localhost:8080/api/v1/orgs/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" }'

Org admins and owners. A PATCH replaces the whole row. A write that would leave a budgeted online rule of any project of the org without a price is 409.

org
required
string

Org UUID or slug.

Media typeapplication/json

Body of POST /models and PATCH /models/{id}. A PATCH replaces the whole row: an absent optional field becomes null (D-T-7).

object
match_pattern

Regular expression, 1–500 bytes. Absent or blank: exactly model_name.

string
model_name
required

Display name, 1–200 characters after trimming.

string
price_cache_read

USD per 1M cache-read tokens.

number format: double
price_cache_write

USD per 1M cache-write tokens.

number format: double
price_input

USD per 1M uncached input tokens, 0–1 000 000.

number format: double
price_output

USD per 1M output tokens, 0–1 000 000.

number format: double
price_reasoning

USD per 1M reasoning tokens. Absent: the output price.

number format: double
provider

Provider, such as openai or gcp.vertex_ai. Absent or blank: any provider.

string
tiers

Up to 8 bands, by strictly increasing min_input_tokens.

Array<object>

One long-context band. A null price uses the row’s base price.

object
min_input_tokens
required

The band applies when the span’s input tokens (cache included) are at least this count.

integer format: int64
price_cache_read

USD per 1M cache-read tokens.

number format: double
price_cache_write

USD per 1M cache-write tokens.

number format: double
price_input

USD per 1M uncached input tokens.

number format: double
price_output

USD per 1M output tokens.

number format: double
price_reasoning

USD per 1M reasoning tokens.

number format: double
valid_from

Absent: the row applies at any time. JSON is RFC 3339.

string format: date-time

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"
}

The created price.

Media typeapplication/json

A price row.

object
created_at

Creation time. Absent on built-in rows. JSON is RFC 3339.

string format: date-time
id

Row id. Absent on built-in rows.

string format: uuid
match_pattern
required

Regular expression matched against the span’s model, anchored and case-insensitive.

string
model_name
required

Display name.

string
price_cache_read

USD per 1M cache-read tokens.

number format: double
price_cache_write

USD per 1M cache-write tokens.

number format: double
price_input

USD per 1M uncached input tokens.

number format: double
price_output

USD per 1M output tokens.

number format: double
price_reasoning

USD per 1M reasoning tokens. Absent: the output price.

number format: double
provider

When set, the row prices spans of this provider (or with none).

string
scope
required

Who owns the row.

string
Allowed values: builtin org project
tiers
required

Long-context bands, by increasing min_input_tokens. Empty when none.

Array<object>

One long-context band. A null price uses the row’s base price.

object
min_input_tokens
required

The band applies when the span’s input tokens (cache included) are at least this count.

integer format: int64
price_cache_read

USD per 1M cache-read tokens.

number format: double
price_cache_write

USD per 1M cache-write tokens.

number format: double
price_input

USD per 1M uncached input tokens.

number format: double
price_output

USD per 1M output tokens.

number format: double
price_reasoning

USD per 1M reasoning tokens.

number format: double
updated_at

Last change. Absent on built-in rows. JSON is RFC 3339.

string format: date-time
valid_from
required

The row prices spans that started at or after this time. JSON is RFC 3339.

string format: date-time

Example

{
"scope": "builtin"
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The request conflicts with the current state.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}