> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.qdrant.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.qdrant.tech/_mcp/server.

# Get optimization progress

GET http://localhost:6333/collections/{collection_name}/optimizations

Get progress of ongoing and completed optimizations for a collection

Reference: https://api.qdrant.tech/api-reference/collections/get-optimizations

## Authentication

- `api-key` header (required) — API Key authentication via header

## Servers

- `http://localhost:6333` (http, default)
- `https://localhost:6333` (https)

## Request

### Path parameters

- `collection_name` (string, required) — Name of the collection

### Query parameters

- `with` (string, optional) — Comma-separated list of optional fields to include in the response. Possible values: queued, completed, idle_segments.
- `completed_limit` (integer, optional, default: 16) — Maximum number of completed optimizations to return. Ignored if `completed` is not in the `with` parameter.

## Response

### 200

successful operation

- `usage` (CollectionsCollectionNameOptimizationsGetResponsesContentApplicationJsonSchemaUsage, optional)
- `time` (double, optional) — Time spent to process this request
- `status` (string, optional)
- `result` (OptimizationsResponse, optional) — Optimizations progress for the collection

## Types

### CollectionsCollectionNameOptimizationsGetResponsesContentApplicationJsonSchemaUsage

### OptimizationsResponse

Optimizations progress for the collection

- `summary` (OptimizationsSummary, required)
- `running` (list of Optimization, required) — Currently running optimizations.
- `queued` (list of PendingOptimization, optional, nullable) — An estimated queue of pending optimizations. Requires `?with=queued`.
- `completed` (list of Optimization, optional, nullable) — Completed optimizations. Requires `?with=completed`. Limited by `?completed_limit=N`.
- `idle_segments` (list of OptimizationSegmentInfo, optional, nullable) — Segments that don't require optimization. Requires `?with=idle_segments`.

### Usage

Usage of the hardware resources, spent to process the request

- `hardware` (UsageHardware, optional)
- `inference` (UsageInference, optional)

### OptimizationsSummary

- `queued_optimizations` (integer, required) — Number of pending optimizations in the queue. Each optimization will take one or more unoptimized segments and produce one optimized segment.
- `queued_segments` (integer, required) — Number of unoptimized segments in the queue.
- `queued_points` (integer, required) — Number of points in unoptimized segments in the queue.
- `idle_segments` (integer, required) — Number of segments that don't require optimization.

### Optimization

- `uuid` (string, required) — Unique identifier of the optimization process. After the optimization is complete, a new segment will be created with this UUID.
- `optimizer` (string, required) — Name of the optimizer that performed this optimization.
- `status` (TrackerStatus, required) — Represents the current state of the optimizer being tracked
- `segments` (list of OptimizationSegmentInfo, required) — Segments being optimized. After the optimization is complete, these segments will be replaced by the new optimized segment.
- `progress` (ProgressTree, required)

### PendingOptimization

- `optimizer` (string, required) — Name of the optimizer that scheduled this optimization.
- `segments` (list of OptimizationSegmentInfo, required) — Segments that will be optimized.

### OptimizationSegmentInfo

- `uuid` (string, required) — Unique identifier of the segment.
- `points_count` (integer, required) — Number of non-deleted points in the segment.

### UsageHardware

### UsageInference

### TrackerStatus

Represents the current state of the optimizer being tracked

### ProgressTree

- `name` (string, required) — Name of the operation.
- `started_at` (string, optional, nullable) — When the operation started.
- `finished_at` (string, optional, nullable) — When the operation finished.
- `duration_sec` (double, optional, nullable) — For finished operations, how long they took, in seconds.
- `done` (uint64, optional, nullable) — Number of completed units of work, if applicable.
- `total` (uint64, optional, nullable) — Total number of units of work, if applicable and known.
- `children` (list of ProgressTree, optional) — Child operations.

### HardwareUsage

Usage of the hardware resources, spent to process the request

- `cpu` (integer, required)
- `payload_io_read` (integer, required)
- `payload_io_write` (integer, required)
- `payload_index_io_read` (integer, required)
- `payload_index_io_write` (integer, required)
- `vector_io_read` (integer, required)
- `vector_io_write` (integer, required)

### InferenceUsage

- `models` (map from string to ModelUsage, required)

### TrackerStatus1

- `cancelled` (string, required)

### TrackerStatus2

- `error` (string, required)

### ModelUsage

- `tokens` (uint64, required)

## Examples

**Response**

```json
{
  "usage": {
    "hardware": {
      "cpu": 1,
      "payload_io_read": 1,
      "payload_io_write": 1,
      "payload_index_io_read": 1,
      "payload_index_io_write": 1,
      "vector_io_read": 1,
      "vector_io_write": 1
    },
    "inference": {
      "models": {}
    }
  },
  "time": 0.002,
  "status": "ok",
  "result": {
    "summary": {
      "queued_optimizations": 1,
      "queued_segments": 1,
      "queued_points": 1,
      "idle_segments": 1
    },
    "running": [
      {
        "uuid": "string",
        "optimizer": "string",
        "status": "optimizing",
        "segments": [
          {
            "uuid": "string",
            "points_count": 1
          }
        ],
        "progress": {
          "name": "string",
          "started_at": "2024-01-15T09:30:00Z",
          "finished_at": "2024-01-15T09:30:00Z",
          "duration_sec": 1.1,
          "done": 1,
          "total": 1,
          "children": [
            null
          ]
        }
      }
    ],
    "queued": [
      {
        "optimizer": "string",
        "segments": [
          {
            "uuid": "string",
            "points_count": 1
          }
        ]
      }
    ],
    "completed": [
      {
        "uuid": "string",
        "optimizer": "string",
        "status": "optimizing",
        "segments": [
          {
            "uuid": "string",
            "points_count": 1
          }
        ],
        "progress": {
          "name": "string",
          "started_at": "2024-01-15T09:30:00Z",
          "finished_at": "2024-01-15T09:30:00Z",
          "duration_sec": 1.1,
          "done": 1,
          "total": 1,
          "children": [
            null
          ]
        }
      }
    ],
    "idle_segments": [
      {
        "uuid": "string",
        "points_count": 1
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "http://localhost:6333/collections/collection_name/optimizations"

headers = {"api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:6333/collections/collection_name/optimizations';
const options = {method: 'GET', headers: {'api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:6333/collections/collection_name/optimizations"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:6333/collections/collection_name/optimizations")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:6333/collections/collection_name/optimizations")
  .header("api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:6333/collections/collection_name/optimizations', [
  'headers' => [
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:6333/collections/collection_name/optimizations");
var request = new RestRequest(Method.GET);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:6333/collections/collection_name/optimizations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```