Skip to main content
PATCH
/
workspaces
/
{id}
Update a workspace
curl --request PATCH \
  --url https://openrouter.ai/api/v1/workspaces/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Updated Workspace",
  "slug": "updated-workspace"
}
'
{
  "data": {
    "created_at": "2025-08-24T10:30:00Z",
    "created_by": "user_abc123",
    "default_image_model": "openai/dall-e-3",
    "default_provider_sort": "price",
    "default_text_model": "openai/gpt-4o",
    "description": "Production environment workspace",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "io_logging_api_key_ids": null,
    "io_logging_sampling_rate": 1,
    "is_data_discount_logging_enabled": true,
    "is_observability_broadcast_enabled": false,
    "is_observability_io_logging_enabled": false,
    "name": "Updated Workspace",
    "slug": "updated-workspace",
    "updated_at": "2025-08-25T10:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Path Parameters

id
string
required

The workspace ID (UUID) or slug

Minimum string length: 1
Example:

"production"

Body

application/json
default_image_model
string | null

Default image model for this workspace

Example:

"openai/dall-e-3"

default_provider_sort
string | null

Default provider sort preference (price, throughput, latency, exacto)

Example:

"price"

default_text_model
string | null

Default text model for this workspace

Example:

"openai/gpt-4o"

description
string | null

New description for the workspace

Maximum string length: 500
Example:

"Updated description"

io_logging_api_key_ids
integer[] | null

Optional array of API key IDs to filter I/O logging

Example:

null

io_logging_sampling_rate
number<double>

Sampling rate for I/O logging (0.0001-1)

Example:

1

is_data_discount_logging_enabled
boolean

Whether data discount logging is enabled

Example:

true

is_observability_broadcast_enabled
boolean

Whether broadcast is enabled

Example:

false

is_observability_io_logging_enabled
boolean

Whether private logging is enabled

Example:

false

name
string

New name for the workspace

Required string length: 1 - 100
Example:

"Updated Workspace"

slug
string

New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens)

Required string length: 1 - 50
Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
Example:

"updated-workspace"

Response

Workspace updated successfully

data
object
required

The updated workspace

Example:
{
  "created_at": "2025-08-24T10:30:00Z",
  "created_by": "user_abc123",
  "default_image_model": "openai/dall-e-3",
  "default_provider_sort": "price",
  "default_text_model": "openai/gpt-4o",
  "description": "Production environment workspace",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "io_logging_api_key_ids": null,
  "io_logging_sampling_rate": 1,
  "is_data_discount_logging_enabled": true,
  "is_observability_broadcast_enabled": false,
  "is_observability_io_logging_enabled": false,
  "name": "Production",
  "slug": "production",
  "updated_at": "2025-08-24T15:45:00Z"
}