---
title: "Upsert workspace LLM config (owner/maintainer)"
method: PUT
path: "/api/workspaces/{id}/llm-config"
tags: ["Workspaces"]
---

# Upsert workspace LLM config (owner/maintainer)

`PUT /api/workspaces/{id}/llm-config`

On update, omitting api_key retains the existing key.

## Path parameters

- `id` string, required

## Request body

- LLMConfigUpsertRequest
  - `api_key` string — optional on update
  - `base_url` string, required
  - `models` LLMModel[], required
    - `id` string, required
    - `name` string, required

## Response `200`

OK

- LLMConfigUpsertResponse
  - `ok` boolean, required

## Other responses

- `400` — validation error (invalid URL / missing field / too many models)
- `403` — insufficient role
- `500` — internal error

## Changes

> 20 revisions in range; 1 could not be searched.

- **2026-05-22** `022de8fbcf5d` — 1 info
  - endpoint added
- **2026-05-22** `1ba39f384b63` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/agentserver/apis/agentserver-api/changes/api/workspaces/:id/llm-config/put.md)

---

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