Skip to content

Model keys

4 calls. Every request needs the Authorization header: see the overview.

GET /tenants/self/model-keys

Every model key of the tenant (the secrets are never served; keyHint shows the last four characters).

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: TenantModelKey[] (200)

curl -X GET "https://api.maitento.com/tenants/self/model-keys" \
-H "Authorization: $MAITENTO_AUTH"
POST /tenants/self/model-keys

Stores a provider key.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: TenantModelKeyCreateRequest

FieldTypeRequiredDescription
providerstring | nullThe vendor: Anthropic, OpenAi, DeepSeek, Gemini, Qwen, Glm or Kimi (case-insensitive). Any other name is refused with api:model-keys:provider-invalid.
labelstring | nullA name for the key, 1–100 characters.
apiKeystring | nullThe provider API key. Write-only: it is never served back (only its last four characters).
baseUrlstring | nullOptional endpoint to call instead of the provider’s default: an absolute https URL to a public host.
modelNameOverridesmap<string, string> | nullOptional map from a model’s id at the provider to the name the endpoint serves it under, typically Azure OpenAI deployment names.
priorityinteger | nullFailover order among the tenant’s keys for this provider, lower first (0–1000). Omitted: after the existing keys.

Response: TenantModelKey (200)

curl -X POST "https://api.maitento.com/tenants/self/model-keys" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"provider":"...","label":"...","apiKey":"...","baseUrl":"...","modelNameOverrides":{},"priority":0}'
DELETE /tenants/self/model-keys/by-id/{id}

Deletes a key. Runs already going stop using it at their next model call.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Response: no body (204)

curl -X DELETE "https://api.maitento.com/tenants/self/model-keys/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH"
PUT /tenants/self/model-keys/by-id/{id}

Replaces a key’s settings (label, endpoint, overrides, priority, enabled); apiKey replaces the key itself.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: TenantModelKeyUpdateRequest

FieldTypeRequiredDescription
labelstring | nullA name for the key, 1–100 characters.
baseUrlstring | nullThe endpoint to call instead of the provider’s default; null or absent clears it.
modelNameOverridesmap<string, string> | nullMap from a model’s id at the provider to the name the endpoint serves it under; null or absent clears it.
priorityintegerFailover order among the tenant’s keys for this provider, lower first (0–1000).
isDisabledbooleanWhether the key is disabled. A disabled key is kept but never used.
apiKeystring | nullA replacement key. Null or absent keeps the stored key.

Response: TenantModelKey (200)

curl -X PUT "https://api.maitento.com/tenants/self/model-keys/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"label":"...","baseUrl":"...","modelNameOverrides":{},"priority":0,"isDisabled":false,"apiKey":"..."}'