For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • API Guides
    • Overview
    • Streaming
    • Embeddings
    • Limits
    • Authentication
    • Parameters
    • Errors and Debugging
  • API Reference
      • GETList workspaces
      • POSTCreate a workspace
      • GETGet a workspace
      • DELDelete a workspace
      • PATCHUpdate a workspace
      • POSTBulk add members to a workspace
      • POSTBulk remove members from a workspace
LogoLogo
ModelsChatRankingsDocs
API ReferenceWorkspaces

Create a workspace

POST
https://openrouter.ai/api/v1/workspaces
POST
/api/v1/workspaces
$curl -X POST https://openrouter.ai/api/v1/workspaces \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Production",
> "slug": "production",
> "default_image_model": "openai/dall-e-3",
> "default_provider_sort": "price",
> "default_text_model": "openai/gpt-4o",
> "description": "Production environment workspace"
>}'
1{
2 "data": {
3 "created_at": "2025-08-24T10:30:00Z",
4 "created_by": "user_abc123",
5 "default_image_model": "openai/dall-e-3",
6 "default_provider_sort": "price",
7 "default_text_model": "openai/gpt-4o",
8 "description": "Production environment workspace",
9 "id": "550e8400-e29b-41d4-a716-446655440000",
10 "io_logging_api_key_ids": null,
11 "io_logging_sampling_rate": 1,
12 "is_data_discount_logging_enabled": true,
13 "is_observability_broadcast_enabled": false,
14 "is_observability_io_logging_enabled": false,
15 "name": "Production",
16 "slug": "production",
17 "updated_at": null
18 }
19}

Create a new workspace for the authenticated user. Management key required.

Was this page helpful?
Previous

Get a workspace

Next
Built with

Authentication

AuthorizationBearer
API key as bearer token in Authorization header

Request

This endpoint expects an object.
namestringRequired1-100 characters
Name for the new workspace
slugstringRequiredformat: "^[a-z0-9]+(?:-[a-z0-9]+)*$"1-50 characters

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

default_image_modelstring or nullOptional
Default image model for this workspace
default_provider_sortstring or nullOptional

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

default_text_modelstring or nullOptional
Default text model for this workspace
descriptionstring or nullOptional<=500 characters
Description of the workspace
io_logging_api_key_idslist of integers or nullOptional

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

io_logging_sampling_ratedoubleOptional

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

is_data_discount_logging_enabledbooleanOptional
Whether data discount logging is enabled
is_observability_broadcast_enabledbooleanOptional
Whether broadcast is enabled
is_observability_io_logging_enabledbooleanOptional
Whether private logging is enabled

Response

Workspace created successfully
dataobject
The created workspace

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error