Tenants — MDDB API

Tenant quotas, request limits and usage (v2.19.8+, GO-054)

Every tenant with its limits and usage #

GET /v1/tenants

Global admin only. Every configured tenant and every tenant a user is assigned to, each with the report of GET /v1/tenants/{id}/usage.

Authorization: BearerAuth or APIKeyAuth or none

Responses #

Status Description Body
200 The tenants object (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 Not a global admin

401 example (application/json)

{
  "error": "missing authentication"
}

A tenant's quota and limits #

GET /v1/tenants/{id}

A global admin, or the tenant's own admin (a user of the tenant with read on "*").

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
id (required) path string The tenant, e.g. acme Pattern ^[a-zA-Z0-9_-]{1,64}$.

Responses #

Status Description Body
200 The stored and the effective configuration TenantConfigView (application/json)
400 Not a valid tenant name
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 Neither a global admin nor the tenant's own admin

401 example (application/json)

{
  "error": "missing authentication"
}

Set a tenant's quota and limits #

PUT /v1/tenants/{id}

Global admin only, on a writable server. A part left out is kept; a part sent as null or {} is removed. Sending neither removes nothing.

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
id (required) path string The tenant, e.g. acme Pattern ^[a-zA-Z0-9_-]{1,64}$.

Request body #

Required.

Content type application/json: object

Property Type Description
quota TenantQuota
limits TenantLimits
{
  "limits": {
    "keyReadPerSecond": 0,
    "keyWritePerSecond": 0,
    "maxConcurrentReindexes": 0,
    "maxConcurrentSearches": 0,
    "maxConcurrentWrites": 0,
    "readPerSecond": 0,
    "writePerSecond": 0
  },
  "quota": {
    "embeddingCallsPerDay": 0,
    "embeddingTokensPerDay": 0,
    "maxBytes": 0,
    "maxCollections": 0,
    "maxDocuments": 0,
    "maxVectors": 0,
    "vectorRamShare": 0
  }
}

Responses #

Status Description Body
200 The tenant's configuration now TenantConfigView (application/json)
400 A negative quota, a share outside 0-1 or a limit below -1
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 Not a global admin, or read-only mode

401 example (application/json)

{
  "error": "missing authentication"
}

Remove a tenant's quota and limits #

DELETE /v1/tenants/{id}

Global admin only. The tenant has no limits of its own afterwards; server defaults still apply.

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
id (required) path string The tenant, e.g. acme Pattern ^[a-zA-Z0-9_-]{1,64}$.

Responses #

Status Description Body
200 Removed object (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 Not a global admin, or read-only mode

401 example (application/json)

{
  "error": "missing authentication"
}

A tenant's usage, queues and refusals #

GET /v1/tenants/{id}/usage

A global admin, or the tenant's own admin.

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
id (required) path string Pattern ^[a-zA-Z0-9_-]{1,64}$.

Responses #

Status Description Body
200 The report TenantUsageReport (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 Neither a global admin nor the tenant's own admin

401 example (application/json)

{
  "error": "missing authentication"
}