space.ai.models()
List the models the project can call.
Lists the models the project can call, with what each one reads, how much it can take and write, whether it can call tools and reasons, and the AI units it uses.
function models(options?: CallOptions): Promise<ModelInfo[]>Parameters
options.signalAbortSignalCancels the call.
options.timeoutMsnumberHow long the call may take, in milliseconds. The
timeoutMsset increateSpacewhen you leave it out, 30,000 by default.
Returns
A promise of a list of models.
The call is sent again, up to retries times, when it fails in a way that may pass, such as a network failure or 503.
Errors
| Code | When |
|---|---|
unauthenticated | The API key is missing or not one we accept |
forbidden | The key may not call models in the project |
Every call can also fail with the codes shared by all of space, such as missing_project or network_error. See SpaceError.
Example
import { space } from "digitospace"
const models = await space.ai.models()
for (const model of models.filter((m) => m.tools)) {
console.log(model.name, model.contextWindow, model.processedIn)
}Last updated