Skip to content
Documentation
Hosted platformREST API reference

Workspace-providers

Bring your own model providers (Pro and Enterprise): a workspace connects its own Azure OpenAI, Amazon Bedrock, Google Vertex AI / Gemini, OpenAI, Anthropic or any OpenAI-compatible endpoint with its own key (stored encrypted, never returned) and maps catalogue targets to models on it.

API version 1.0.0openapi.json

Bring your own model providers (Pro and Enterprise): a workspace connects its own Azure OpenAI, Amazon Bedrock, Google Vertex AI / Gemini, OpenAI, Anthropic or any OpenAI-compatible endpoint with its own key (stored encrypted, never returned) and maps catalogue targets to models on it. Its `/route` (`execute=true`), `/v1/chat/completions` and MCP `ask` calls then run on that endpoint; unmapped targets keep the platform's providers. Reading needs membership, writing the `admin` role.

get/api/v1/workspace/providers

List Providers

The workspace's providers (keys masked), their target mappings, what the platform executes on for comparison, the presets and the targets that can be mapped. `enabled` says whether the plan includes the feature; without it the list is read-only and empty.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/workspace/providers" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/workspace/providers

Create Provider

Connect an OpenAI-compatible endpoint with the workspace's own credentials (stored encrypted).

Requires an API key.

Request bodyWorkspaceProviderIn

FieldTypeDefaultDescription
api_keystring | null
api_key_headerstring | null
base_url(required)string
enabledbooleantrue
extra_headersobject<string>
kindstring"custom"
max_retriesinteger2
name(required)string
notesstring""
timeout_snumber60

Responses

201Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/workspace/providers" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "base_url": "string", "name": "default" }'
Bodyjson
{
  "base_url": "string",
  "name": "default"
}

put/api/v1/workspace/providers/models/{target_id}

Map Target

Execute `target_id on the workspace's provider_id as model` (optional system prompt and request defaults). Replaces an earlier mapping of the same target.

Requires an API key.

Parameters

NameInTypeDefaultDescription
target_id(required)pathstring

Request bodyWorkspaceMappingIn

FieldTypeDefaultDescription
defaultsobject
model(required)string
provider_id(required)string
system_promptstring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PUT "$OSR_URL/api/v1/workspace/providers/models/<target_id>" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "auto", "provider_id": "string" }'
Bodyjson
{
  "model": "auto",
  "provider_id": "string"
}

delete/api/v1/workspace/providers/models/{target_id}

Unmap Target

Requires an API key.

Parameters

NameInTypeDefaultDescription
target_id(required)pathstring

Responses

204Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/workspace/providers/models/<target_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/workspace/providers/{provider_id}

Get Provider

Requires an API key.

Parameters

NameInTypeDefaultDescription
provider_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/workspace/providers/<provider_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

patch/api/v1/workspace/providers/{provider_id}

Patch Provider

Change the endpoint, rotate the key (`api_key), drop it (clear_api_key`), disable or rename.

Requires an API key.

Parameters

NameInTypeDefaultDescription
provider_id(required)pathstring

Request bodyWorkspaceProviderPatch

FieldTypeDefaultDescription
api_keystring | null
api_key_headerstring | null
base_urlstring | null
clear_api_keybooleanfalse
enabledboolean | null
extra_headersobject<string> | null
kindstring | null
max_retriesinteger | null
namestring | null
notesstring | null
timeout_snumber | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PATCH "$OSR_URL/api/v1/workspace/providers/<provider_id>" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "api_key": "string", "api_key_header": "string", "base_url": "string", "enabled": false, "extra_headers": {}, "kind": "string", "max_retries": 1, "name": "default" }'
Bodyjson
{
  "api_key": "string",
  "api_key_header": "string",
  "base_url": "string",
  "enabled": false,
  "extra_headers": {},
  "kind": "string",
  "max_retries": 1,
  "name": "default"
}

delete/api/v1/workspace/providers/{provider_id}

Delete Provider

Remove the provider and every mapping on it; the targets fall back to the platform's providers.

Requires an API key.

Parameters

NameInTypeDefaultDescription
provider_id(required)pathstring

Responses

204Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/workspace/providers/<provider_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/workspace/providers/{provider_id}/check

Check Provider

Call the endpoint's `/models` with the stored credentials: reachability, latency, upstream model ids.

Requires an API key.

Parameters

NameInTypeDefaultDescription
provider_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/workspace/providers/<provider_id>/check" \
  -H "Authorization: Bearer $OSR_API_KEY"