---
title: "PATCH /api/workspaces/{workspace_id}/settings/generative-ai/"
method: PATCH
path: "/api/workspaces/{workspace_id}/settings/generative-ai/"
tags: ["Workspaces"]
---

# PATCH /api/workspaces/{workspace_id}/settings/generative-ai/

`PATCH /api/workspaces/{workspace_id}/settings/generative-ai/`

Updates the generative AI models settings for the given workspace.

## Path parameters

- `workspace_id` integer, required

## Headers

- `ClientSessionId` string, uuid

## Request body

- PatchedGenerativeAISettings
  - `openai` OpenAISettings
    - `models` string[] — The models that are enabled for this AI type.
    - `api_key` string — The OpenAI API key that is used to authenticate with the OpenAI API.
    - `organization` string — The organization that the OpenAI API key belongs to.
    - `base_url` string, uri — https://api.openai.com/v1 by default, but can be changed to https://eu.api.openai.com/v1, https://<your-resource-name>.openai.azure.com,or any other OpenAI compatible API.
  - `anthropic` AnthropicSettings
    - `models` string[] — The models that are enabled for this AI type.
    - `api_key` string — The Anthropic API key that is used to authenticate with the Anthropic API.
  - `mistral` MistralSettings
    - `models` string[] — The models that are enabled for this AI type.
    - `api_key` string — The Mistral API key that is used to authenticate with the Mistral API.
  - `ollama` OllamaSettings
    - `models` string[] — The models that are enabled for this AI type.
    - `host` string — The host that is used to authenticate with the Ollama API.
  - `openrouter` OpenRouterSettings
    - `models` string[] — The models that are enabled for this AI type.
    - `api_key` string — The OpenRouter API key that is used to authenticate with the OpenAI API.
    - `organization` string — The organization that the OpenRouter API key belongs to.

## Response `200`

- Workspace
  - `id` integer, required
  - `name` string, required
  - `generative_ai_models_enabled` string, required

## Other responses

- `400`
- `404`

---

[API](https://skmtc.dev/baserow/apis/baserow-api-spec.md) · [All operations](https://skmtc.dev/baserow/apis/baserow-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/baserow/baserow-api-spec/revisions/f3396317d932/schema)
