Skip to content

Applies to Cowork 0.1.45 · For everyone who uses Cowork

Models ​

Lets a Mini App use the AI models already set up in Cowork. API keys stay inside Cowork and never reach the page. Each call is one request and one reply: no tools, no chat history.

MAESTROSDK.llm.providers() Not yet released ​

Lists the model providers that are ready to use (signed in or with a key), with their models and reasoning efforts.

Parameters ​

None.

Returns ​

Promise<Provider[]>. An empty list when nothing is set up, when the page has no Cowork tab identity, or when the call fails.

FieldTypeDescription
idstringProvider id, passed to complete as provider
labelstringName to show
models[].idstringModel id, passed as model
models[].labelstringName to show
models[].defaultEffortstringThe effort Cowork uses by default
models[].efforts[]{ id, label }[]Efforts this model accepts; pass an id as effort

Example ​

js
const providers = await MAESTROSDK.llm.providers();
const first = providers[0]?.models[0];

MAESTROSDK.llm.complete(request) Not yet released ​

Sends one prompt to one model and returns its text reply.

Parameters ​

NameTypeRequiredDescription
request.providerstringYesA provider id from providers()
request.modelstringYesA model id of that provider
request.effortstringYesAn effort id of that model
request.promptstringYesThe prompt, at most 32,000 characters

One call waits at most 120 seconds for the model.

Returns ​

Promise<{ ok: true, text: string } | { ok: false, error: string }>

Errors ​

errorMeaning
provider, model, effort and prompt are requiredA field is missing or empty
prompt_too_longThe prompt is over 32,000 characters
empty_promptThe prompt is only spaces
unknown_modelThe combination is not in providers()
empty_replyThe model returned no text
no_instanceThe page has no Cowork tab identity
host_unavailableCowork could not take the call
Any other textThe model's own error message, or model_failed

Example ​

js
const [provider] = await MAESTROSDK.llm.providers();
const model = provider.models[0];
const reply = await MAESTROSDK.llm.complete({
  provider: provider.id,
  model: model.id,
  effort: model.defaultEffort,
  prompt: 'Summarise this note in one sentence: ...'
});
if (reply.ok) show(reply.text); else showError(reply.error);

For Micromeet Cowork 0.1.41 · build 261111110020