GROK BOT / set-model-access-and-parameters-via-admin-api

Grok Bot

Set model access and parameters with the Admin API

Enable or disable a single model, and optionally set per-model parameter restrictions and defaults, with PUT https://api.cursor.com/teams/model-access/providers/:provider/models/:model. Official reference: Admin API → Model access. These routes are in preview and may change before general availability.

Authenticate with a team Admin API key (Basic auth, key as username, empty password). Writes require models:* or admin:*. Generic read:* keys cannot call these routes. Rate limit: 20 requests per minute. Writes appear in team audit logs as team_settings events.

Returns 409 when the team is still unrestricted or legacy. Seed configuration first: Set model access configuration with the Admin API. Discover supported parameter ids with List model access providers.

Enabling a model without parameter settings leaves it on the catalog defaults. Use per-model settings when those defaults, such as Fast, do not match your team's policy.

Path and body

Field Rules
provider Required catalog provider id (for example anthropic)
model Required catalog model id (for example claude-opus-4-6)
enabled Required boolean
parameters Optional map from parameter id to settings; omitted parameters and fields stay unchanged

Inside each parameters entry:

Key Rules
allowedValues string[] or null — restrict which values members may pick; null clears the restriction
defaultValue string or null — team default; must sit inside allowedValues when a restriction is set; null restores the catalog default

Disable Fast on a model

curl -X PUT https://api.cursor.com/teams/model-access/providers/anthropic/models/claude-opus-4-6 \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "parameters": {
      "fast": { "allowedValues": ["false"] }
    }
  }'

Set allowed reasoning levels and a default

curl -X PUT https://api.cursor.com/teams/model-access/providers/openai/models/gpt-5.4 \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "parameters": {
      "reasoning": {
        "allowedValues": ["low", "medium", "high"],
        "defaultValue": "high"
      }
    }
  }'

Clear a restriction and restore the catalog default

curl -X PUT https://api.cursor.com/teams/model-access/providers/openai/models/gpt-5.4 \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "parameters": {
      "reasoning": {
        "allowedValues": null,
        "defaultValue": null
      }
    }
  }'

Example response after clearing:

{
  "id": "gpt-5.4",
  "displayName": "GPT-5.4",
  "enabled": true,
  "provider": "openai",
  "parameters": [
    {
      "id": "reasoning",
      "displayName": "Reasoning",
      "supportedValues": ["low", "medium", "high", "xhigh", "max"],
      "allowedValues": ["low", "medium", "high", "xhigh", "max"],
      "configuredDefaultValue": null,
      "catalogDefaultValue": "medium"
    }
  ]
}

Errors

Error bodies use { "code": "error", "message": "…" }.

Status When
401 Bad key, or missing models:read / models:* (or admin:*)
403 Model access control is not available for that team
409 Provider or model read or write while state is unrestricted or legacy
400 Unknown provider, model, parameter id, or parameter value; invalid body; empty allowedValues; default outside allowedValues; settings that resolve to no valid model variant; or a Smart Auto required model would be blocked

Pitfalls

  • Writing while state is unrestricted or legacy — expect 409 until configuration seeds a custom policy.
  • Passing an empty allowedValues array — that returns 400; use null to clear a restriction.
  • Setting defaultValue outside allowedValues400.
  • Using display names in the path — use catalog ids from the list GET.
  • Leaving parameters off when you need to override catalog defaults such as Fast — omitted parameters keep catalog defaults.