> For the complete documentation index, see [llms.txt](https://learn.getvectorai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.getvectorai.com/vector-search/inserting-into-vector-ai/400-inserting-with-api/400-inserting-with-api-encoding-while-inserting.md).

# Inserting with API - encoding while inserting (recommended)

If you are looking to encode while inserting, then you will need a deployed model or rely on one of Vector AI's models. The main advantage of this is that you can immediately get your deployment to start working. You can take a look at the following for inserting and encoding.

```python
import requests
url = "https://vectorai-development-api.azurewebsites.net/collection/insert_and_encode"
requests.post(
    url=url,
    json={
        "username": username,
        "api_key": api_key,
        "collection_name": collection_name,
        "documents": documents,
        "encoders": [
        ]
    }
)
```
