You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9506aa6
Browse filesBrowse the repository at this point in the historyBrowse files
exe.dev user
committed
Preserve saved model API keys when editing integrations
Copy file name to clipboardExpand all lines: packages/api-client/src/schema.d.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -169,8 +169,8 @@ export interface paths {
169
169
};
170
170
get?: never;
171
171
/**
172
-
* Replace a model account credential
173
-
* @description Owner session required. Saves an OpenAI-compatible provider URL and optional API key. Replaces the managed credential without changing the selected account ID; active runs use the replacement on their next request.
172
+
* Update a model account credential
173
+
* @description Owner session required. An omitted API key preserves the saved key when the provider URL is unchanged. Supply a replacement key or explicit null for keyless access when changing the provider URL. Active runs use the updated credential on their next request.
description: "Requires an interactive owner browser session and the current collection revision. Saves an OpenAI-compatible provider URL, optional API key, and model limits in encrypted storage. Credentials are never returned.",
270
270
responses: {"201": {description: "Created model account",content: {"application/json": {schema: jsonSchema(bearerIntegrationWriteResult,"output")}}}},
271
271
},(service,{ body })=>service.createModelAccount(body),{body: modelAccountCreate,maxBodyBytes: 70_000,ownerSession: true}),
272
-
route("PUT","/api/v1/model-accounts/{accountId}","integrations:write",{summary:"Replace a model account credential",description:"Owner session required. Saves an OpenAI-compatible provider URL and optional API key. Replaces the managed credential without changing the selected account ID; active runs use the replacement on their next request.",responses:{"200":{description:"Model account updated",content:{"application/json":{schema:jsonSchema(bearerIntegrationWriteResult,"output")}}}}},(service,{params,body})=>service.updateModelAccount(params.accountId,body),{body:modelAccountCreate.omit({id:true}),maxBodyBytes:70_000,ownerSession:true,parameters:z.object({accountId:z.uuid()})}),
272
+
route("PUT","/api/v1/model-accounts/{accountId}","integrations:write",{summary:"Update a model account credential",description:"Owner session required. An omitted API key preserves the saved key when the provider URL is unchanged. Supply a replacement key or explicit null for keyless access when changing the provider URL. Active runs use the updated credential on their next request.",responses:{"200":{description:"Model account updated",content:{"application/json":{schema:jsonSchema(bearerIntegrationWriteResult,"output")}}}}},(service,{params,body})=>service.updateModelAccount(params.accountId,body),{body:modelAccountCreate.omit({id:true}).extend({apiKey:modelProviderConfiguration.shape.apiKey.unwrap().nullable().optional().meta({writeOnly:true})}),maxBodyBytes:70_000,ownerSession:true,parameters:z.object({accountId:z.uuid()})}),
catch(error){if(errorinstanceofStaleIntegrationRevisionError)thrownewServiceError(409,"stale_revision","The model account collection changed. Reload and retry.");if(errorinstanceofIntegrationIdempotencyConflictError)thrownewServiceError(409,"conflict",error.message);if(errorinstanceofIntegrationValidationError)thrownewServiceError(400,"invalid_request",error.message);throwerror;}
<Label>API key (optional)<SecretInputname="model-api-key"aria-label="API key (optional)"maxLength={32768}value={key}onChange={event=>setKey(event.target.value)}/><spanclassName="text-xs">Blank saves a keyless integration. Enter the replacement key when editing an authenticated provider.</span></Label>
38
+
<Label>API key (optional)<SecretInputdisabled={keyless}name="model-api-key"aria-label="API key (optional)"maxLength={32768}value={key}onChange={event=>setKey(event.target.value)}/><spanclassName="text-xs">{editId?"Leave blank to keep the saved API key. Enter a new key to replace it.":"Enter your provider API key, or leave blank for a keyless provider."}</span></Label>
39
+
{editId&&<Label><spanclassName="flex items-center gap-2"><inputtype="checkbox"checked={keyless}onChange={event=>setKeyless(event.target.checked)}/>Use keyless access (remove saved API key)</span></Label>}
<Buttonvariant="primary"disabled={save.isPending||accounts.isPending||Boolean(accounts.error)}>{save.isPending?"Saving…":"Save model integration"}</Button>
constedit=async()=>{awaitpage.getByRole("button",{name:"Actions for OpenAI",exact:true}).click();awaitpage.getByRole("menuitem",{name:"Edit model integration"}).click();};
Copy file name to clipboardExpand all lines: packages/docs/openapi.yaml
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2702,9 +2702,9 @@ paths:
2702
2702
additionalProperties: false
2703
2703
/api/v1/model-accounts/{accountId}:
2704
2704
put:
2705
-
summary: Replace a model account credential
2705
+
summary: Update a model account credential
2706
2706
description: |-
2707
-
Owner session required. Saves an OpenAI-compatible provider URL and optional API key. Replaces the managed credential without changing the selected account ID; active runs use the replacement on their next request.
2707
+
Owner session required. An omitted API key preserves the saved key when the provider URL is unchanged. Supply a replacement key or explicit null for keyless access when changing the provider URL. Active runs use the updated credential on their next request.
0 commit comments