Set or change the instance's own AI account
const url = 'https://forge.example.com/api/platform/ai-account';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"vendor":"example","model":"example","identity":"example","apiKey":"example","workspaceId":"example","region":"example","monthlyTokens":1,"reason":"example","version":1,"resourceName":"example","deployment":"example","project":"example","endpoint":"example","routineModel":"example","routineDeployment":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://forge.example.com/api/platform/ai-account \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "vendor": "example", "model": "example", "identity": "example", "apiKey": "example", "workspaceId": "example", "region": "example", "monthlyTokens": 1, "reason": "example", "version": 1, "resourceName": "example", "deployment": "example", "project": "example", "endpoint": "example", "routineModel": "example", "routineDeployment": "example" }'For an operator administrator, with a reason. A vendor this build can use, the model as the vendor names it, identity key (the default) or instance (the server’s own AWS identity, on Amazon Bedrock, when the server has one), the apiKey, the workspaceId for an Anthropic key made for a whole organization, the region for Amazon Bedrock, and monthlyTokens. The key is sealed with the instance’s own keys before it is stored, and never answered; left out, the key set here is kept for the same vendor. An account set here is in effect at once on every instance of the API, in place of the server’s settings. Send the version you read, 0 for the first: a stale one answers 409 with currentVersion.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "vendor": "example", "model": "example", "identity": "example", "apiKey": "example", "workspaceId": "example", "region": "example", "monthlyTokens": 1, "reason": "example", "version": 1, "resourceName": "example", "deployment": "example", "project": "example", "endpoint": "example", "routineModel": "example", "routineDeployment": "example"}Responses
Section titled “Responses”OK
object
object
object
object
object
object
Example
{ "account": { "key": { "revealable": false } }, "console": { "key": { "revealable": false } }, "vendors": [ { "models": [ { "retentionRequired": false } ], "identity": "key" } ]}default
Section titled “default”A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}