Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview

Update a model provider

Changes a BYOK provider in place. An omitted field is left as it stands, including its credential: send api_key or auth only to replace it – or with a base_url other than the stored one, which is refused without one, so a stored key never reaches an endpoint it was not given for. A key is write-only – it is sealed on arrival and no response carries it – and replacing the credential keeps the provider’s id, so agent versions already published against it go on resolving.

PATCH/v1/model-providers/{model_provider_id}
Authorization
AuthorizationBearer token · headerrequired
Path parameters
model_provider_idstring<uuid>required
Model provider id
Request body
requiredapplication/json
api_keystring | null
A new upstream key, sealed and put in place of the stored credential: shorthand for an `api_key` auth. Write-only: no route answers with a key, so there is nothing to read back and nothing to compare against.
min length 1 · max length 16384
authany | ModelProviderAuthInput
Show properties
One of:
any
any
ModelProviderAuthInput
One of:
object
api_keystringrequired
Write-only: no route answers with a key.
min length 1 · max length 16384
typestringrequired
Allowed:api_key
object
regionstringrequired
The region the role's signatures are scoped to, which the base URL's host must name.
max length 32
role_arnstringrequired
The IAM role to assume, `arn:aws:iam::<account>:role/<name>`. Its trust policy must admit this workspace's subject alone.
max length 2048
typestringrequired
Allowed:aws_web_identity
object
federation_rule_idstringrequired
The federation rule the workspace's token is checked against, `fdrl_...`. Its match must admit this workspace's subject alone.
max length 128
organization_idstring<uuid>required
The Anthropic organization's id.
service_account_idstringrequired
The service account the access token acts as, `svac_...`.
max length 128
typestringrequired
Allowed:anthropic_workload_identity
workspace_idstring | null
The Anthropic workspace the token is scoped to, `wrkspc_...`. Required when the rule is enabled for more than one workspace.
max length 128
object
identity_provider_idstringrequired
The workload identity provider that trusts this deployment's issuer, as the OpenAI dashboard shows it.
max length 128
service_account_idstringrequired
The service account the access token acts as. The provider's mapping to it must admit this workspace's subject alone.
max length 128
typestringrequired
Allowed:openai_workload_identity
base_urlstring | null
The upstream base URL. One other than the stored one takes `api_key` or `auth` with it: the stored credential was given for the stored endpoint, so it never travels to a new one. A federated provider restates its identity, which `GET` reads back. The stored one, in any spelling of it, takes neither.
max length 2048
descriptionstring | null
max length 1024
display_namestring | null
max length 200
Responses
200The updated provider; the API key is never returned.
One of:
object
created_atstring<date-time>required
descriptionstringrequired
display_namestringrequired
formatModelProviderFormatBodyrequired
The wire format a provider speaks, which decides the shape of the model settings an agent config may carry for it.
Allowed:anthropicopenai_responses
idstring<uuid>required
updated_atstring<date-time>required
When the provider last changed: a rename, a new endpoint, or a new key.
modelsPlatformModelBody[]required
Models available through this platform provider.
Show properties
Array of PlatformModelBody
descriptionstringrequired
display_namestringrequired
modelstringrequired
priceany | ModelPriceBodyrequired
Show properties
One of:
any
any
ModelPriceBody
One of:
object
formatstringrequired
Allowed:anthropic
per_tokenAnthropicPriceBodyrequired
Show properties
cache_readinteger<int64>required
cache_writeinteger<int64>required
inputinteger<int64>required
outputinteger<int64>required
object
formatstringrequired
Allowed:openai_responses
per_tokenOpenaiResponsesPriceBodyrequired
`input` prices the input neither read from nor written to the cache, `cached_input` the part read and `cache_write` the part written; `output` prices every output token, reasoning included.
Show properties
cache_writeinteger<int64>required
cached_inputinteger<int64>required
inputinteger<int64>required
outputinteger<int64>required
typestringrequired
Allowed:platform
object
created_atstring<date-time>required
descriptionstringrequired
display_namestringrequired
formatModelProviderFormatBodyrequired
The wire format a provider speaks, which decides the shape of the model settings an agent config may carry for it.
Allowed:anthropicopenai_responses
idstring<uuid>required
updated_atstring<date-time>required
When the provider last changed: a rename, a new endpoint, or a new key.
authModelProviderAuthBodyrequired
How a BYOK provider authenticates, as read back: a key never comes back, so its arm says only that there is one.
Show properties
One of:
object
typestringrequired
Allowed:api_key
object
regionstringrequired
role_arnstringrequired
typestringrequired
Allowed:aws_web_identity
object
federation_rule_idstringrequired
organization_idstringrequired
service_account_idstringrequired
typestringrequired
Allowed:anthropic_workload_identity
workspace_idstring | nullrequired
Null when the rule picks its one workspace itself.
object
identity_provider_idstringrequired
service_account_idstringrequired
typestringrequired
Allowed:openai_workload_identity
base_urlstringrequired
Where the proxy sends this provider's calls, as the workspace set it. Its API key never comes back.
workspace_idstring<uuid>required
typestringrequired
Allowed:byok
400Malformed body, path parameter, a field outside its bound, a base URL other than the stored one sent with no `api_key` or `auth`, a base URL the network policy or the provider's auth refuses, or a role that does not trust this workspace alone.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks model_provider.manage, or the provider is a platform row, which only the operator changes.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such provider, or the caller cannot see it.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
429This workspace checked roles' trust too often in the last minute; try again later.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PATCH "https://api.us.cloud.subako.ai/v1/model-providers/497f6eca-6276-4993-bfeb-53cbbbba6f08" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "string",
  "auth": {},
  "base_url": "string",
  "description": "string",
  "display_name": "string"
}'
Response
{
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "display_name": "string",
  "format": "anthropic",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "updated_at": "2019-08-24T14:15:22Z",
  "models": [
    {
      "description": "string",
      "display_name": "string",
      "model": "string",
      "price": {}
    }
  ],
  "type": "platform"
}