MechaMental
Api reference

Model Entitlements

List Workspace Entitlements

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/model-entitlements

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Query Parameters

enabled_only?Enabled Only
Defaultfalse
limit?Limit
Default50
Range1 <= value <= 100
cursor?string|null

Header Parameters

authorization?string|null

Response Body

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/model-entitlements"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "entitlements": [
    {
      "entitlement_id": "string",
      "workspace_id": "string",
      "org_id": "string",
      "logical_model_id": "string",
      "workspace_limits": {},
      "allowed_step_types": [
        "string"
      ],
      "allowed_endpoints": [
        "string"
      ],
      "allowed_purposes": [
        "string"
      ],
      "enabled": true,
      "request_count": 0,
      "total_tokens": 0,
      "last_used_at": "string",
      "granted_by": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Grant Model Entitlement

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/model-entitlements

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/model-entitlements" \  -H "Content-Type: application/json" \  -d '{    "logical_model_id": "string"  }'
{
  "entitlement_id": "string",
  "workspace_id": "string",
  "org_id": "string",
  "logical_model_id": "string",
  "workspace_limits": {},
  "allowed_step_types": [
    "string"
  ],
  "allowed_endpoints": [
    "string"
  ],
  "allowed_purposes": [
    "string"
  ],
  "enabled": true,
  "request_count": 0,
  "total_tokens": 0,
  "last_used_at": "string",
  "granted_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Model Entitlement

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/model-entitlements/{logical_model_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
logical_model_id*Logical Model Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/model-entitlements/string"
{
  "entitlement_id": "string",
  "workspace_id": "string",
  "org_id": "string",
  "logical_model_id": "string",
  "workspace_limits": {},
  "allowed_step_types": [
    "string"
  ],
  "allowed_endpoints": [
    "string"
  ],
  "allowed_purposes": [
    "string"
  ],
  "enabled": true,
  "request_count": 0,
  "total_tokens": 0,
  "last_used_at": "string",
  "granted_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Model Entitlement

PATCH
/v1/orgs/{org_id}/workspaces/{workspace_id}/model-entitlements/{logical_model_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
logical_model_id*Logical Model Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://loading/v1/orgs/string/workspaces/string/model-entitlements/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "entitlement_id": "string",
  "workspace_id": "string",
  "org_id": "string",
  "logical_model_id": "string",
  "workspace_limits": {},
  "allowed_step_types": [
    "string"
  ],
  "allowed_endpoints": [
    "string"
  ],
  "allowed_purposes": [
    "string"
  ],
  "enabled": true,
  "request_count": 0,
  "total_tokens": 0,
  "last_used_at": "string",
  "granted_by": "string",
  "created_at": "string",
  "updated_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Revoke Model Entitlement

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/model-entitlements/{logical_model_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
logical_model_id*Logical Model Id

Header Parameters

authorization?string|null

Response Body

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/model-entitlements/string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}