# init

#### init

Initializes the API connection with the embedded model. Must be called before using any other API methods.

#### Signature

```typescript
init(): Promise<void>
```

#### Parameters

None.

#### Returns

`Promise<void>` - Resolves when the connection is established and the model is ready.

#### Usage

```javascript
import { VctrModelApi } from "https://app.vectary.com/studio-lite/scripts/api.js";

const api = new VctrModelApi("vectary-embed");
await api.init();

// Now you can use other API methods
const objects = await api.getObjects();
```

#### Notes

* Always `await` this method before calling other API methods
* Each iframe requires its own API instance and `init()` call
* The Promise resolves when the model has finished loading


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.vectary.com/api/model-api/api-reference/init.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
