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

# Get a dataset

GET https://api.ideogram.ai/datasets/{dataset_id}

Returns a dataset by ID, including the total number of files and a list of each file's name and size in bytes.


Reference: https://developer.ideogram.ai/v1/api-reference/custom-model-training/get-dataset

## Authentication

- `Api-Key` header (required) — API key for access control. Use in the header with the name \"Api-Key\"

## Request

### Path parameters

- `dataset_id` (string, required)

## Response

### 200

Dataset retrieved successfully

- `dataset` (Dataset, required) — A dataset for organizing training images.
- `file_count` (integer, required) — Total number of files in the dataset.
- `files` (list of DatasetFile, required) — List of files in the dataset.
- `custom_model_ids` (list of string, required) — IDs of all custom models trained from this dataset. Empty array if no model has been trained yet.

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Dataset not found

- `any`

## Types

### Dataset

A dataset for organizing training images.

- `dataset_id` (string, required) — Unique identifier for the dataset.
- `name` (string, required) — Display name of the dataset.
- `user_id` (string, required) — ID of the user who owns this dataset.
- `creation_time` (datetime, required) — When the dataset was created.

### DatasetFile

A file in a dataset.

- `file_name` (string, required, nullable) — Filename of the file in the dataset.
- `file_size_bytes` (integer, optional, nullable) — Size of the file in bytes, if available.
- `caption` (string, optional, nullable) — Caption applied to the file, if any. A v4 structured caption is returned as a JSON-encoded string; a plain-text caption (from a .txt sidecar) is returned unchanged. Only present when the file has a caption.

## Examples

**Response**

```json
{
  "dataset": {
    "dataset_id": "dataset_id",
    "name": "name",
    "user_id": "user_id",
    "creation_time": "2024-01-15T09:30:00Z"
  },
  "file_count": 0,
  "files": [
    {
      "file_name": "file_name",
      "file_size_bytes": 6,
      "caption": "caption"
    },
    {
      "file_name": "file_name",
      "file_size_bytes": 6,
      "caption": "caption"
    }
  ],
  "custom_model_ids": [
    "custom_model_ids",
    "custom_model_ids"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.ideogram.ai/datasets/dataset_id"

headers = {"Api-Key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.ideogram.ai/datasets/dataset_id';
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 := "https://api.ideogram.ai/datasets/dataset_id"

	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("https://api.ideogram.ai/datasets/dataset_id")

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

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("https://api.ideogram.ai/datasets/dataset_id")
  .header("Api-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.ideogram.ai/datasets/dataset_id', [
  'headers' => [
    'Api-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/datasets/dataset_id");
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: "https://api.ideogram.ai/datasets/dataset_id")! 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()
```