(version1.engines)
Enumerate engines that work with 'Version 1' REST API endpoints.
- fetchList - List engines
List all engines available to your organization/user
import { StabilityAIClient } from "stabilityai-client-typescript";
const stabilityAIClient = new StabilityAIClient({
stabilityApiKey: process.env["STABILITYAICLIENT_STABILITY_API_KEY"] ?? "",
});
async function run() {
const result = await stabilityAIClient.version1.engines.fetchList({
organization: "org-123456",
stabilityClientID: "my-great-plugin",
stabilityClientVersion: "1.2.1",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { StabilityAIClientCore } from "stabilityai-client-typescript/core.js";
import { version1EnginesFetchList } from "stabilityai-client-typescript/funcs/version1EnginesFetchList.js";
// Use `StabilityAIClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stabilityAIClient = new StabilityAIClientCore({
stabilityApiKey: process.env["STABILITYAICLIENT_STABILITY_API_KEY"] ?? "",
});
async function run() {
const res = await version1EnginesFetchList(stabilityAIClient, {
organization: "org-123456",
stabilityClientID: "my-great-plugin",
stabilityClientVersion: "1.2.1",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FetchListRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.Engine[]>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 401 | application/json |
errors.ErrorT | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |