# Endpoint APIs

## List All Endpoints:

```
curl 'https://api.spotprod.segmind.com/endpoint/list' \
  --header 'content-type: application/json' \
  --header 'x-api-key: SG_XXXXX'
```

## Add Endpoint

```
curl 'https://api.spotstage.segmind.com/endpoint/add' \
  --header 'content-type: application/json' \
  --header 'x-api-key: SG_XXXXX' \
  --data-raw '{"endpoint_name":"replace-with-endpoint-name","model_name":"replace-with-model-name","workers_min":0,"workers_max":1,"idle_timeout":60,"execution_timeout":600,"scaler_type":"REQUEST_COUNT","scaler_value":1,"gpu_id":"AMPERE_80"}'
```

## Update Endpoint&#x20;

```
curl -XPUT 'https://api.spotprod.segmind.com/endpoint/update' \
  --header 'content-type: application/json' \
  --header 'x-api-key: SG_XXXXX' \
  --data-raw '{"workers_min":0,"workers_max":2,"endpoint_id":"tpr9hugy367nbz","scaler_type":"REQUEST_COUNT","scaler_value":1,"idle_timeout":60,"execution_timeout":600,"force_update":false}'
```

{% hint style="info" %}
Use this API to automate endpoint capacity updates on schedule or demand
{% endhint %}

## Delete Endpoint

```
curl 'https://api.spotprod.segmind.com/endpoint/delete' \
  --header 'content-type: application/json' \
  --header 'x-api-key: SG_XXXXX' \
  --data-raw '{"endpoint_id":"tpr9hugy367nbz"}
```
