Skip to main content

AI Gateway API

Table of Contents

Top

upsquad/aigateway/v1/models_catalog.proto

AIGatewayCatalogConfig

AIGatewayCatalogConfig is the combined Get/Update payload.

FieldTypeLabelDescription
providersProviderrepeatedProviders is the full platform provider list.
modelsModelrepeatedModels is the full platform model list.
tenant_overridesTenantOverriderepeatedTenantOverrides is the caller's tenant-scoped overrides on top of the catalog. Server-stamped; entries for other tenants are never returned.
updated_atgoogle.protobuf.TimestampUpdatedAt is stamped server-side on every Update. Never accepted from the client.

GetAIGatewayCatalogConfigRequest

GetAIGatewayCatalogConfigRequest is empty — tenant id is sourced from the authenticated context.

GetAIGatewayCatalogConfigResponse

GetAIGatewayCatalogConfigResponse carries the merged catalog.

FieldTypeLabelDescription
configAIGatewayCatalogConfigConfig is the merged catalog: platform providers + platform models + the caller's tenant overrides. Tenant overrides for other tenants are never returned.

Model

Model is a registered model with its token budget and provider binding. Platform-global — tenant overrides live in TenantOverride.

FieldTypeLabelDescription
idstringID is the on-the-wire model id (e.g. "claude-opus-4-7").
provider_idstringProviderID is the foreign key into Provider.id. Validation rejects unknown provider ids.
display_namestringDisplayName is the human-facing label.
max_input_tokensint64MaxInputTokens is the compile-time context-window ceiling. 0 means "no ceiling — defer to provider".
max_output_tokensint64MaxOutputTokens is the per-call output ceiling (tokens). 0 means "no ceiling".

Provider

Provider is a platform-registered LLM provider. Global — all tenants see the same list. Enabled=false hides the provider's models from the runtime router without deleting the row.

FieldTypeLabelDescription
idstringID is the stable identifier, lowercase dotted (e.g. "anthropic", "openai"). Immutable primary key.
display_namestringDisplayName is the human-facing label rendered in the catalog UI.
enabledboolEnabled gates every model owned by this provider. Flipping to false is effectively a platform-wide disable.
default_base_urlstringDefaultBaseURL overrides the provider SDK's hard-coded base URL when non-empty. Used for private-region routes or self-hosted compatible gateways.

TenantOverride

TenantOverride is a per-tenant tweak on top of the platform catalog. tenant_id is server-stamped from the authenticated context — never accepted from the wire.

FieldTypeLabelDescription
model_idstringModelID must match a Model.id in the catalog. A row referencing a missing model is rejected at Update time.
enabledboolEnabled hides the model from the caller's tenant when false, regardless of the platform-level Model/Provider state.
rate_limit_rpmint32RateLimitRPM caps requests-per-minute for this tenant on this model. 0 means "use the platform default".

UpdateAIGatewayCatalogConfigRequest

UpdateAIGatewayCatalogConfigRequest carries the desired new catalog. L5 actors see providers + models applied; L4 actors see only tenant_overrides applied (providers / models are ignored with a server-side log line, not an error, to keep the round-trip simple).

FieldTypeLabelDescription
configAIGatewayCatalogConfigConfig is the desired new catalog. L5 actors may mutate providers + models + tenant_overrides; L4 actors mutate tenant_overrides only (platform fields on the wire are dropped server-side).

UpdateAIGatewayCatalogConfigResponse

UpdateAIGatewayCatalogConfigResponse echoes the merged catalog after the write.

FieldTypeLabelDescription
configAIGatewayCatalogConfigConfig is the merged catalog after the write, same shape as Get.

AIGatewayCatalogConfigService

AIGatewayCatalogConfigService exposes the providers / models catalog as a single Get/Update pair. LLD-4 §2.1 shape.

Method NameRequest TypeResponse TypeDescription
GetAIGatewayCatalogConfigGetAIGatewayCatalogConfigRequestGetAIGatewayCatalogConfigResponseGet the merged catalog (platform providers + platform models + caller's tenant overrides). Read-only, L3.
UpdateAIGatewayCatalogConfigUpdateAIGatewayCatalogConfigRequestUpdateAIGatewayCatalogConfigResponseUpdate replaces the catalog for the caller's scope: - L5 actor: full catalog (providers + models + tenant overrides) - L4 actor: tenant overrides only; providers / models ignored Emits one config.updated audit event on success.

Top

upsquad/aigateway/v1/provider_key.proto

SetProviderKeyRequest

SetProviderKeyRequest carries the provider id + the raw secret. The tenant is taken from the auth context (never from the request body).

FieldTypeLabelDescription
providerstringprovider is the lowercase provider id, e.g. "anthropic"
api_keystringapi_key is the raw provider secret. It is stored encrypted in the vault and is NEVER echoed back, logged, or persisted to any table.

SetProviderKeyResponse

SetProviderKeyResponse confirms the write WITHOUT returning the secret.

FieldTypeLabelDescription
providerstringprovider echoes the stored provider id.
key_hintstringkey_hint is a masked fingerprint (last 4 chars only), safe to render in the UI to confirm which key was stored — e.g. "••••AB12".
createdboolcreated is true when this was a first-time set, false when it rotated an existing key for the same (tenant, provider).
updated_atgoogle.protobuf.Timestampupdated_at is the server time the key was written.

AIGatewayProviderKeyService

AIGatewayProviderKeyService is the thin tenant BYOK key-write surface. Write-only: there is deliberately no Get/List RPC — secret material never leaves the vault after it is set.

Method NameRequest TypeResponse TypeDescription
SetProviderKeySetProviderKeyRequestSetProviderKeyResponseSetProviderKey upserts the caller tenant's API key for an LLM provider. Idempotent on (org, "_default", provider): a second call rotates the key. Emits one provider_key.set audit event on success carrying only the provider + a masked hint — never the raw key. Requires L4 clearance.

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)