# Endpoint SDK

## Let's start:soon:

### Import package&#x20;

```python
from innocuous_sdk.endpoint import Endpoint
```

### Login

Use `user_name` and `user_token` to login, and start to use the following methods

```python
endpoint = Endpoint('<user_name>', '<user_token>')
```

### Methods

### List all running endpoint

List all running endpoint

```python
endpoint_list = endpoint.list_endpoint()
```

### Get endpoint id by name

```python
endpoint_id = endpoint.get_endpoint_id('<my-endpoint-nema>')
```

### Get endpoint information

```python
result = endpoint.get_endpoint(endpoint_id)
```

### Predict with json body

```python
data = { "images": [  
            "https://file.innocuous.ai/3.jpg", 
            "https://file.innocuous.ai/7.jpg", 
            "https://file.innocuous.ai/8.jpg"
        ]}
result = endpoint.predict_json(endpoint_id, data)
```

### Predict with local files

```python
files = [
    '/local/path/file/1.jpg',
    '/local/path/file/2.jpg',
    '/local/path/file/3.jpg',
    '/local/path/file/4.jpg'
]
result = endpoint.predict_file(endpoint_id, files)
```

### Upload dataset

```python
result = endpoint.upload_dataset(endpoint_id, '/local/path/file/test.zip')
```


---

# 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://innocuous-book.gitbook.io/innocuous-book/endpoint/endpoint-sdk.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.
