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

Grok Bot

Set model access and parameters with the Organization API

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

Authenticate with an Organization API key (Basic auth, key as username, empty password). Writes need models:* (or admin:*). Rate limit: 20 requests per minute. Writes appear in team audit logs as team_settings events. Enterprise organizations; target teams must have model access control available.

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

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 organization policy.

Path and body

Field Rules
teamId Integer ID of a team linked to the organization
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

Unknown or unlinked teamId returns 404. Teams without model access control available return 403.

Disable Fast on a model

curl -X PUT https://api.cursor.com/organizations/teams/7/model-access/providers/anthropic/models/claude-opus-4-6 \
  -u YOUR_ORGANIZATION_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/organizations/teams/7/model-access/providers/openai/models/gpt-5.4 \
  -u YOUR_ORGANIZATION_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/organizations/teams/7/model-access/providers/openai/models/gpt-5.4 \
  -u YOUR_ORGANIZATION_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "parameters": {
      "reasoning": {
        "allowedValues": null,
        "defaultValue": null
      }
    }
  }'

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
404 Team is not linked to the organization
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.

To apply the same model toggle across many linked teams, see Bulk set model access and parameters. For the single-team Admin API counterpart, see Set model access and parameters with the Admin API.