Skip to content
Start here

AI Gateway

List Gateways
ai_gateway.list(AIGatewayListParams**kwargs) -> SyncV4PagePaginationArray[AIGatewayListResponse]
GET/accounts/{account_id}/ai-gateway/gateways
Fetch a Gateway
ai_gateway.get(strid, AIGatewayGetParams**kwargs) -> AIGatewayGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{id}
Create a new Gateway
ai_gateway.create(AIGatewayCreateParams**kwargs) -> AIGatewayCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways
Update a Gateway
ai_gateway.update(strid, AIGatewayUpdateParams**kwargs) -> AIGatewayUpdateResponse
PUT/accounts/{account_id}/ai-gateway/gateways/{id}
Delete a Gateway
ai_gateway.delete(strid, AIGatewayDeleteParams**kwargs) -> AIGatewayDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{id}
ModelsExpand Collapse
class AIGatewayListResponse:
id: str

gateway id

maxLength64
minLength1
cache_invalidate_on_update: bool
cache_ttl: Optional[int]
minimum0
collect_logs: bool
created_at: datetime
formatdate-time
modified_at: datetime
formatdate-time
rate_limiting_interval: Optional[int]
minimum0
rate_limiting_limit: Optional[int]
minimum0
authentication: Optional[bool]
dlp: Optional[DLP]
One of the following:
class DLPUnionMember0:
action: Literal["BLOCK", "FLAG"]
One of the following:
"BLOCK"
"FLAG"
enabled: bool
profiles: List[str]
class DLPUnionMember1:
enabled: bool
policies: List[DLPUnionMember1Policy]
id: str
action: Literal["FLAG", "BLOCK"]
One of the following:
"FLAG"
"BLOCK"
check: List[Literal["REQUEST", "RESPONSE"]]
One of the following:
"REQUEST"
"RESPONSE"
enabled: bool
profiles: List[str]
is_default: Optional[bool]
log_management: Optional[int]
maximum10000000
minimum10000
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]]
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: Optional[bool]
logpush_public_key: Optional[str]
maxLength1024
minLength16
otel: Optional[List[Otel]]
authorization: str
headers: Dict[str, str]
url: str
content_type: Optional[Literal["json", "protobuf"]]
One of the following:
"json"
"protobuf"
rate_limiting_technique: Optional[Literal["fixed", "sliding"]]
One of the following:
"fixed"
"sliding"
retry_backoff: Optional[Literal["constant", "linear", "exponential"]]

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: Optional[int]

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: Optional[int]

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: Optional[str]
stripe: Optional[Stripe]
authorization: str
usage_events: List[StripeUsageEvent]
payload: str
workers_ai_billing_mode: Optional[Literal["postpaid"]]

Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.

zdr: Optional[bool]
class AIGatewayGetResponse:
id: str

gateway id

maxLength64
minLength1
cache_invalidate_on_update: bool
cache_ttl: Optional[int]
minimum0
collect_logs: bool
created_at: datetime
formatdate-time
modified_at: datetime
formatdate-time
rate_limiting_interval: Optional[int]
minimum0
rate_limiting_limit: Optional[int]
minimum0
authentication: Optional[bool]
dlp: Optional[DLP]
One of the following:
class DLPUnionMember0:
action: Literal["BLOCK", "FLAG"]
One of the following:
"BLOCK"
"FLAG"
enabled: bool
profiles: List[str]
class DLPUnionMember1:
enabled: bool
policies: List[DLPUnionMember1Policy]
id: str
action: Literal["FLAG", "BLOCK"]
One of the following:
"FLAG"
"BLOCK"
check: List[Literal["REQUEST", "RESPONSE"]]
One of the following:
"REQUEST"
"RESPONSE"
enabled: bool
profiles: List[str]
is_default: Optional[bool]
log_management: Optional[int]
maximum10000000
minimum10000
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]]
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: Optional[bool]
logpush_public_key: Optional[str]
maxLength1024
minLength16
otel: Optional[List[Otel]]
authorization: str
headers: Dict[str, str]
url: str
content_type: Optional[Literal["json", "protobuf"]]
One of the following:
"json"
"protobuf"
rate_limiting_technique: Optional[Literal["fixed", "sliding"]]
One of the following:
"fixed"
"sliding"
retry_backoff: Optional[Literal["constant", "linear", "exponential"]]

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: Optional[int]

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: Optional[int]

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: Optional[str]
stripe: Optional[Stripe]
authorization: str
usage_events: List[StripeUsageEvent]
payload: str
workers_ai_billing_mode: Optional[Literal["postpaid"]]

Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.

zdr: Optional[bool]
class AIGatewayCreateResponse:
id: str

gateway id

maxLength64
minLength1
cache_invalidate_on_update: bool
cache_ttl: Optional[int]
minimum0
collect_logs: bool
created_at: datetime
formatdate-time
modified_at: datetime
formatdate-time
rate_limiting_interval: Optional[int]
minimum0
rate_limiting_limit: Optional[int]
minimum0
authentication: Optional[bool]
dlp: Optional[DLP]
One of the following:
class DLPUnionMember0:
action: Literal["BLOCK", "FLAG"]
One of the following:
"BLOCK"
"FLAG"
enabled: bool
profiles: List[str]
class DLPUnionMember1:
enabled: bool
policies: List[DLPUnionMember1Policy]
id: str
action: Literal["FLAG", "BLOCK"]
One of the following:
"FLAG"
"BLOCK"
check: List[Literal["REQUEST", "RESPONSE"]]
One of the following:
"REQUEST"
"RESPONSE"
enabled: bool
profiles: List[str]
is_default: Optional[bool]
log_management: Optional[int]
maximum10000000
minimum10000
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]]
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: Optional[bool]
logpush_public_key: Optional[str]
maxLength1024
minLength16
otel: Optional[List[Otel]]
authorization: str
headers: Dict[str, str]
url: str
content_type: Optional[Literal["json", "protobuf"]]
One of the following:
"json"
"protobuf"
rate_limiting_technique: Optional[Literal["fixed", "sliding"]]
One of the following:
"fixed"
"sliding"
retry_backoff: Optional[Literal["constant", "linear", "exponential"]]

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: Optional[int]

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: Optional[int]

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: Optional[str]
stripe: Optional[Stripe]
authorization: str
usage_events: List[StripeUsageEvent]
payload: str
workers_ai_billing_mode: Optional[Literal["postpaid"]]

Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.

zdr: Optional[bool]
class AIGatewayUpdateResponse:
id: str

gateway id

maxLength64
minLength1
cache_invalidate_on_update: bool
cache_ttl: Optional[int]
minimum0
collect_logs: bool
created_at: datetime
formatdate-time
modified_at: datetime
formatdate-time
rate_limiting_interval: Optional[int]
minimum0
rate_limiting_limit: Optional[int]
minimum0
authentication: Optional[bool]
dlp: Optional[DLP]
One of the following:
class DLPUnionMember0:
action: Literal["BLOCK", "FLAG"]
One of the following:
"BLOCK"
"FLAG"
enabled: bool
profiles: List[str]
class DLPUnionMember1:
enabled: bool
policies: List[DLPUnionMember1Policy]
id: str
action: Literal["FLAG", "BLOCK"]
One of the following:
"FLAG"
"BLOCK"
check: List[Literal["REQUEST", "RESPONSE"]]
One of the following:
"REQUEST"
"RESPONSE"
enabled: bool
profiles: List[str]
is_default: Optional[bool]
log_management: Optional[int]
maximum10000000
minimum10000
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]]
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: Optional[bool]
logpush_public_key: Optional[str]
maxLength1024
minLength16
otel: Optional[List[Otel]]
authorization: str
headers: Dict[str, str]
url: str
content_type: Optional[Literal["json", "protobuf"]]
One of the following:
"json"
"protobuf"
rate_limiting_technique: Optional[Literal["fixed", "sliding"]]
One of the following:
"fixed"
"sliding"
retry_backoff: Optional[Literal["constant", "linear", "exponential"]]

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: Optional[int]

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: Optional[int]

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: Optional[str]
stripe: Optional[Stripe]
authorization: str
usage_events: List[StripeUsageEvent]
payload: str
workers_ai_billing_mode: Optional[Literal["postpaid"]]

Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.

zdr: Optional[bool]
class AIGatewayDeleteResponse:
id: str

gateway id

maxLength64
minLength1
cache_invalidate_on_update: bool
cache_ttl: Optional[int]
minimum0
collect_logs: bool
created_at: datetime
formatdate-time
modified_at: datetime
formatdate-time
rate_limiting_interval: Optional[int]
minimum0
rate_limiting_limit: Optional[int]
minimum0
authentication: Optional[bool]
dlp: Optional[DLP]
One of the following:
class DLPUnionMember0:
action: Literal["BLOCK", "FLAG"]
One of the following:
"BLOCK"
"FLAG"
enabled: bool
profiles: List[str]
class DLPUnionMember1:
enabled: bool
policies: List[DLPUnionMember1Policy]
id: str
action: Literal["FLAG", "BLOCK"]
One of the following:
"FLAG"
"BLOCK"
check: List[Literal["REQUEST", "RESPONSE"]]
One of the following:
"REQUEST"
"RESPONSE"
enabled: bool
profiles: List[str]
is_default: Optional[bool]
log_management: Optional[int]
maximum10000000
minimum10000
log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]]
One of the following:
"STOP_INSERTING"
"DELETE_OLDEST"
logpush: Optional[bool]
logpush_public_key: Optional[str]
maxLength1024
minLength16
otel: Optional[List[Otel]]
authorization: str
headers: Dict[str, str]
url: str
content_type: Optional[Literal["json", "protobuf"]]
One of the following:
"json"
"protobuf"
rate_limiting_technique: Optional[Literal["fixed", "sliding"]]
One of the following:
"fixed"
"sliding"
retry_backoff: Optional[Literal["constant", "linear", "exponential"]]

Backoff strategy for retry delays

One of the following:
"constant"
"linear"
"exponential"
retry_delay: Optional[int]

Delay between retry attempts in milliseconds (0-5000)

maximum5000
minimum0
retry_max_attempts: Optional[int]

Maximum number of retry attempts for failed requests (1-5)

maximum5
minimum1
store_id: Optional[str]
stripe: Optional[Stripe]
authorization: str
usage_events: List[StripeUsageEvent]
payload: str
workers_ai_billing_mode: Optional[Literal["postpaid"]]

Controls how Workers AI inference calls routed through this gateway are billed. Only 'postpaid' is currently supported.

zdr: Optional[bool]

AI GatewayEvaluation Types

List Evaluators
ai_gateway.evaluation_types.list(EvaluationTypeListParams**kwargs) -> SyncV4PagePaginationArray[EvaluationTypeListResponse]
GET/accounts/{account_id}/ai-gateway/evaluation-types
ModelsExpand Collapse
class EvaluationTypeListResponse:
id: str
created_at: datetime
formatdate-time
description: str
enable: bool
mandatory: bool
modified_at: datetime
formatdate-time
name: str
type: str

AI GatewayLogs

List Gateway Logs
ai_gateway.logs.list(strgateway_id, LogListParams**kwargs) -> SyncV4PagePaginationArray[LogListResponse]
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Detail
ai_gateway.logs.get(strid, LogGetParams**kwargs) -> LogGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Patch Gateway Log
ai_gateway.logs.edit(strid, LogEditParams**kwargs) -> object
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}
Delete Gateway Logs
ai_gateway.logs.delete(strgateway_id, LogDeleteParams**kwargs) -> LogDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs
Get Gateway Log Request
ai_gateway.logs.request(strid, LogRequestParams**kwargs) -> object
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/request
Get Gateway Log Response
ai_gateway.logs.response(strid, LogResponseParams**kwargs) -> object
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs/{id}/response
ModelsExpand Collapse
class LogListResponse:
id: str
cached: bool
created_at: datetime
formatdate-time
duration: int
model: str
path: str
provider: str
success: bool
tokens_in: Optional[int]
tokens_out: Optional[int]
cost: Optional[float]
custom_cost: Optional[bool]
metadata: Optional[str]
model_type: Optional[str]
request_content_type: Optional[str]
request_type: Optional[str]
response_content_type: Optional[str]
status_code: Optional[int]
step: Optional[int]
class LogGetResponse:
id: str
cached: bool
created_at: datetime
formatdate-time
duration: int
model: str
path: str
provider: str
success: bool
tokens_in: Optional[int]
tokens_out: Optional[int]
cost: Optional[float]
custom_cost: Optional[bool]
metadata: Optional[str]
model_type: Optional[str]
request_content_type: Optional[str]
request_head: Optional[str]
request_head_complete: Optional[bool]
request_size: Optional[int]
request_type: Optional[str]
response_content_type: Optional[str]
response_head: Optional[str]
response_head_complete: Optional[bool]
response_size: Optional[int]
status_code: Optional[int]
step: Optional[int]
class LogDeleteResponse:
success: bool

AI GatewayDatasets

List Datasets
ai_gateway.datasets.list(strgateway_id, DatasetListParams**kwargs) -> SyncV4PagePaginationArray[DatasetListResponse]
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets
Fetch a Dataset
ai_gateway.datasets.get(strid, DatasetGetParams**kwargs) -> DatasetGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
Create a new Dataset
ai_gateway.datasets.create(strgateway_id, DatasetCreateParams**kwargs) -> DatasetCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets
Update a Dataset
ai_gateway.datasets.update(strid, DatasetUpdateParams**kwargs) -> DatasetUpdateResponse
PUT/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
Delete a Dataset
ai_gateway.datasets.delete(strid, DatasetDeleteParams**kwargs) -> DatasetDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}
ModelsExpand Collapse
class DatasetListResponse:
id: str
created_at: datetime
formatdate-time
enable: bool
filters: List[Filter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
class DatasetGetResponse:
id: str
created_at: datetime
formatdate-time
enable: bool
filters: List[Filter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
class DatasetCreateResponse:
id: str
created_at: datetime
formatdate-time
enable: bool
filters: List[Filter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
class DatasetUpdateResponse:
id: str
created_at: datetime
formatdate-time
enable: bool
filters: List[Filter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
class DatasetDeleteResponse:
id: str
created_at: datetime
formatdate-time
enable: bool
filters: List[Filter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str

AI GatewayEvaluations

List Evaluations
ai_gateway.evaluations.list(strgateway_id, EvaluationListParams**kwargs) -> SyncV4PagePaginationArray[EvaluationListResponse]
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations
Fetch a Evaluation
ai_gateway.evaluations.get(strid, EvaluationGetParams**kwargs) -> EvaluationGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}
Create a new Evaluation
ai_gateway.evaluations.create(strgateway_id, EvaluationCreateParams**kwargs) -> EvaluationCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations
Delete a Evaluation
ai_gateway.evaluations.delete(strid, EvaluationDeleteParams**kwargs) -> EvaluationDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations/{id}
ModelsExpand Collapse
class EvaluationListResponse:
id: str
created_at: datetime
formatdate-time
datasets: List[Dataset]
id: str
account_id: str
account_tag: str
created_at: datetime
formatdate-time
enable: bool
filters: List[DatasetFilter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
processed: bool
results: List[Result]
id: str
created_at: datetime
formatdate-time
evaluation_id: str
evaluation_type_id: str
modified_at: datetime
formatdate-time
result: str
status: float
status_description: str
total_logs: float
total_logs: float
class EvaluationGetResponse:
id: str
created_at: datetime
formatdate-time
datasets: List[Dataset]
id: str
account_id: str
account_tag: str
created_at: datetime
formatdate-time
enable: bool
filters: List[DatasetFilter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
processed: bool
results: List[Result]
id: str
created_at: datetime
formatdate-time
evaluation_id: str
evaluation_type_id: str
modified_at: datetime
formatdate-time
result: str
status: float
status_description: str
total_logs: float
total_logs: float
class EvaluationCreateResponse:
id: str
created_at: datetime
formatdate-time
datasets: List[Dataset]
id: str
account_id: str
account_tag: str
created_at: datetime
formatdate-time
enable: bool
filters: List[DatasetFilter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
processed: bool
results: List[Result]
id: str
created_at: datetime
formatdate-time
evaluation_id: str
evaluation_type_id: str
modified_at: datetime
formatdate-time
result: str
status: float
status_description: str
total_logs: float
total_logs: float
class EvaluationDeleteResponse:
id: str
created_at: datetime
formatdate-time
datasets: List[Dataset]
id: str
account_id: str
account_tag: str
created_at: datetime
formatdate-time
enable: bool
filters: List[DatasetFilter]
key: Literal["created_at", "request_content_type", "response_content_type", 10 more]
One of the following:
"created_at"
"request_content_type"
"response_content_type"
"success"
"cached"
"provider"
"model"
"cost"
"tokens"
"tokens_in"
"tokens_out"
"duration"
"feedback"
operator: Literal["eq", "contains", "lt", "gt"]
One of the following:
"eq"
"contains"
"lt"
"gt"
value: List[Union[str, float, bool]]
One of the following:
str
float
bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
name: str
processed: bool
results: List[Result]
id: str
created_at: datetime
formatdate-time
evaluation_id: str
evaluation_type_id: str
modified_at: datetime
formatdate-time
result: str
status: float
status_description: str
total_logs: float
total_logs: float

AI GatewayDynamic Routing

List all AI Gateway Dynamic Routes.
ai_gateway.dynamic_routing.list(strgateway_id, DynamicRoutingListParams**kwargs) -> DynamicRoutingListResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Get an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.get(strid, DynamicRoutingGetParams**kwargs) -> DynamicRoutingGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Create a new AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.create(strgateway_id, DynamicRoutingCreateParams**kwargs) -> DynamicRoutingCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes
Update an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.update(strid, DynamicRoutingUpdateParams**kwargs) -> DynamicRoutingUpdateResponse
PATCH/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
Delete an AI Gateway Dynamic Route.
ai_gateway.dynamic_routing.delete(strid, DynamicRoutingDeleteParams**kwargs) -> DynamicRoutingDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}
List all AI Gateway Dynamic Route Deployments.
ai_gateway.dynamic_routing.list_deployments(strid, DynamicRoutingListDeploymentsParams**kwargs) -> DynamicRoutingListDeploymentsResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
Create a new AI Gateway Dynamic Route Deployment.
ai_gateway.dynamic_routing.create_deployment(strid, DynamicRoutingCreateDeploymentParams**kwargs) -> DynamicRoutingCreateDeploymentResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/deployments
List all AI Gateway Dynamic Route Versions.
ai_gateway.dynamic_routing.list_versions(strid, DynamicRoutingListVersionsParams**kwargs) -> DynamicRoutingListVersionsResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Create a new AI Gateway Dynamic Route Version.
ai_gateway.dynamic_routing.create_version(strid, DynamicRoutingCreateVersionParams**kwargs) -> DynamicRoutingCreateVersionResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions
Get an AI Gateway Dynamic Route Version.
ai_gateway.dynamic_routing.get_version(strversion_id, DynamicRoutingGetVersionParams**kwargs) -> DynamicRoutingGetVersionResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/routes/{id}/versions/{version_id}
ModelsExpand Collapse
class DynamicRoutingListResponse:
data: Data
order_by: str
order_by_direction: str
page: float
per_page: float
routes: List[DataRoute]
id: str
account_tag: str
created_at: datetime
formatdate-time
deployment: DataRouteDeployment
created_at: str
deployment_id: str
version_id: str
elements: List[DataRouteElement]
One of the following:
class DataRouteElementUnionMember0:
id: str
outputs: DataRouteElementUnionMember0Outputs
type: Literal["start"]
class DataRouteElementUnionMember1:
id: str
outputs: DataRouteElementUnionMember1Outputs
false: DataRouteElementUnionMember1OutputsFalse_
element_id: str
true: DataRouteElementUnionMember1OutputsTrue_
element_id: str
properties: DataRouteElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class DataRouteElementUnionMember2:
id: str
outputs: Dict[str, DataRouteElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class DataRouteElementUnionMember3:
id: str
outputs: DataRouteElementUnionMember3Outputs
fallback: DataRouteElementUnionMember3OutputsFallback
element_id: str
success: DataRouteElementUnionMember3OutputsSuccess
element_id: str
properties: DataRouteElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class DataRouteElementUnionMember4:
id: str
outputs: DataRouteElementUnionMember4Outputs
fallback: DataRouteElementUnionMember4OutputsFallback
element_id: str
success: DataRouteElementUnionMember4OutputsSuccess
element_id: str
properties: DataRouteElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class DataRouteElementUnionMember5:
id: str
outputs: Dict[str, DataRouteElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: DataRouteVersion
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingGetResponse:
id: str
created_at: datetime
formatdate-time
deployment: Deployment
created_at: str
deployment_id: str
version_id: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: Version
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
class DynamicRoutingCreateResponse:
id: str
created_at: datetime
formatdate-time
deployment: Deployment
created_at: str
deployment_id: str
version_id: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: Version
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
class DynamicRoutingUpdateResponse:
route: Route
id: str
account_tag: str
created_at: datetime
formatdate-time
deployment: RouteDeployment
created_at: str
deployment_id: str
version_id: str
elements: List[RouteElement]
One of the following:
class RouteElementUnionMember0:
id: str
outputs: RouteElementUnionMember0Outputs
type: Literal["start"]
class RouteElementUnionMember1:
id: str
outputs: RouteElementUnionMember1Outputs
false: RouteElementUnionMember1OutputsFalse_
element_id: str
true: RouteElementUnionMember1OutputsTrue_
element_id: str
properties: RouteElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class RouteElementUnionMember2:
id: str
outputs: Dict[str, RouteElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class RouteElementUnionMember3:
id: str
outputs: RouteElementUnionMember3Outputs
fallback: RouteElementUnionMember3OutputsFallback
element_id: str
success: RouteElementUnionMember3OutputsSuccess
element_id: str
properties: RouteElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class RouteElementUnionMember4:
id: str
outputs: RouteElementUnionMember4Outputs
fallback: RouteElementUnionMember4OutputsFallback
element_id: str
success: RouteElementUnionMember4OutputsSuccess
element_id: str
properties: RouteElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class RouteElementUnionMember5:
id: str
outputs: Dict[str, RouteElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version: RouteVersion
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingDeleteResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingListDeploymentsResponse:
data: Data
deployments: List[DataDeployment]
created_at: str
deployment_id: str
version_id: str
order_by: str
order_by_direction: str
page: float
per_page: float
success: bool
class DynamicRoutingCreateDeploymentResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingListVersionsResponse:
data: Data
order_by: str
order_by_direction: str
page: float
per_page: float
versions: List[DataVersion]
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
version_id: str
success: bool
class DynamicRoutingCreateVersionResponse:
id: str
created_at: datetime
formatdate-time
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
class DynamicRoutingGetVersionResponse:
id: str
active: Literal["true", "false"]
One of the following:
"true"
"false"
created_at: str
data: str
elements: List[Element]
One of the following:
class ElementUnionMember0:
id: str
outputs: ElementUnionMember0Outputs
type: Literal["start"]
class ElementUnionMember1:
id: str
outputs: ElementUnionMember1Outputs
false: ElementUnionMember1OutputsFalse_
element_id: str
true: ElementUnionMember1OutputsTrue_
element_id: str
properties: ElementUnionMember1Properties
conditions: Optional[object]
type: Literal["conditional"]
class ElementUnionMember2:
id: str
outputs: Dict[str, ElementUnionMember2Outputs]
element_id: str
type: Literal["percentage"]
class ElementUnionMember3:
id: str
outputs: ElementUnionMember3Outputs
fallback: ElementUnionMember3OutputsFallback
element_id: str
success: ElementUnionMember3OutputsSuccess
element_id: str
properties: ElementUnionMember3Properties
key: str
limit: float
limit_type: Literal["count", "cost"]
One of the following:
"count"
"cost"
window: float
type: Literal["rate"]
class ElementUnionMember4:
id: str
outputs: ElementUnionMember4Outputs
fallback: ElementUnionMember4OutputsFallback
element_id: str
success: ElementUnionMember4OutputsSuccess
element_id: str
properties: ElementUnionMember4Properties
model: str
provider: str
retries: float
timeout: float
type: Literal["model"]
class ElementUnionMember5:
id: str
outputs: Dict[str, ElementUnionMember5Outputs]
element_id: str
type: Literal["end"]
gateway_id: str
modified_at: datetime
formatdate-time
name: str
version_id: str

AI GatewayProvider Configs

List Provider Configs
ai_gateway.provider_configs.list(strgateway_id, ProviderConfigListParams**kwargs) -> SyncV4PagePaginationArray[ProviderConfigListResponse]
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs
Create a new Provider Configs
ai_gateway.provider_configs.create(strgateway_id, ProviderConfigCreateParams**kwargs) -> ProviderConfigCreateResponse
POST/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs
ModelsExpand Collapse
class ProviderConfigListResponse:
id: str
alias: str
default_config: bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
provider_slug: str
secret_id: str
secret_preview: str
rate_limit: Optional[float]
rate_limit_period: Optional[float]
class ProviderConfigCreateResponse:
id: str
alias: str
default_config: bool
gateway_id: str

gateway id

maxLength64
minLength1
modified_at: datetime
formatdate-time
provider_slug: str
secret_id: str
secret_preview: str
rate_limit: Optional[float]
rate_limit_period: Optional[float]

AI GatewayURLs

Get Gateway URL
ai_gateway.urls.get(strprovider, URLGetParams**kwargs) -> URLGetResponse
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/url/{provider}
ModelsExpand Collapse
str