> 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.

# Train a custom Ideogram v3 model

POST https://api.ideogram.ai/v1/ideogram-v3/train-model
Content-Type: application/json

Start training a custom Ideogram v3 model from a dataset using default hyperparameters. The dataset must contain at least 15 images and a maximum of 100 images.


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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a TrainModelV3Request.

- `dataset_id` (string, required) — ID of the dataset to train the model from.
- `model_name` (string, required) — Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.

## Response

### 200

Training started successfully

- `model_id` (string, required) — Unique identifier of the created model.
- `dataset_id` (string, required) — Identifier of the dataset used for training.
- `training_status` (string, required) — Current training status of the model.
- `model_name` (string, required) — Name of the model.

## Errors

### 400 Bad Request Error

Bad request

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Dataset not found

- `any`

## Examples

**Request**

```json
{
  "dataset_id": "abc123",
  "model_name": "my-custom-model"
}
```

**Response**

```json
{
  "model_id": "model_id",
  "dataset_id": "dataset_id",
  "training_status": "training_status",
  "model_name": "model_name"
}
```

**SDK Code**

```python
import requests

url = "https://api.ideogram.ai/v1/ideogram-v3/train-model"

payload = {
    "dataset_id": "abc123",
    "model_name": "my-custom-model"
}
headers = {
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.ideogram.ai/v1/ideogram-v3/train-model';
const options = {
  method: 'POST',
  headers: {'Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"dataset_id":"abc123","model_name":"my-custom-model"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ideogram.ai/v1/ideogram-v3/train-model"

	payload := strings.NewReader("{\n  \"dataset_id\": \"abc123\",\n  \"model_name\": \"my-custom-model\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/v1/ideogram-v3/train-model")

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

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"dataset_id\": \"abc123\",\n  \"model_name\": \"my-custom-model\"\n}"

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.post("https://api.ideogram.ai/v1/ideogram-v3/train-model")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"dataset_id\": \"abc123\",\n  \"model_name\": \"my-custom-model\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ideogram.ai/v1/ideogram-v3/train-model', [
  'body' => '{
  "dataset_id": "abc123",
  "model_name": "my-custom-model"
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.ideogram.ai/v1/ideogram-v3/train-model");
var request = new RestRequest(Method.POST);
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"dataset_id\": \"abc123\",\n  \"model_name\": \"my-custom-model\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "dataset_id": "abc123",
  "model_name": "my-custom-model"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ideogram.ai/v1/ideogram-v3/train-model")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```