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

# Tiêu chí AI Insights

GET https://api.omicx.one/customers/ai-insight-config

**Scope yêu cầu:** `customer:read`. Nội dung mà bản tóm tắt AI (AI Insight) của một khách hàng sẽ hiển thị, và model mà các card đó chạy trên. Chưa từng cấu hình → `enabled: false, modelId: null, cards: []`. Mọi card đều chạy trên cùng một `modelId`; `null` nghĩa là dùng model mặc định của nền tảng. Không lộ prompt. `id` của card: với card `SYSTEM` là mã kỹ năng (ví dụ `customer_sentiment`), với card `CUSTOM` là id của card đó. Card `SYSTEM` không có `name` sẽ lấy tên kỹ năng từ master data; card `SYSTEM` kiểu 1 lựa chọn lấy sẵn danh sách giá trị mặc định của kỹ năng từ master data — cả hai theo ngôn ngữ của tenant (mặc định `vi`). `options`/`fromValue`/`toValue` chỉ xuất hiện khi có giá trị.

Reference: https://developers.omicx.one/customer-config/attributes/get-customer-ai-insight-config

## Request

### Headers

- `X-Api-Key` (string, required)

## Response

### 200

Cấu hình AI Insight.

- `enabled` (boolean, optional)
- `modelId` (string, optional, nullable) — Model mà mọi card cùng chạy trên; `null` = dùng model mặc định của nền tảng.
- `cards` (list of CustomerAiInsightConfigCardsItems, optional)

## Errors

### 401 Unauthorized Error

`API_KEY_REQUIRED` hoặc `API_KEY_INVALID`.

- `error` (ErrorResponseError, optional)

### 403 Forbidden Error

`INSUFFICIENT_SCOPE`.

- `error` (ErrorResponseError, optional)

### 429 Too Many Requests Error

`RATE_LIMIT_EXCEEDED`.

- `error` (ErrorResponseError, optional)

### 502 Bad Gateway Error

`CUSTOMER_SERVICE_UNAVAILABLE` — upstream timeout/lỗi 5xx, kèm `Retry-After: 5`.

- `error` (ErrorResponseError, optional)

## Types

### CustomerAiInsightConfigCardsItems

- `id` (string, optional) — Card `SYSTEM` → mã kỹ năng (ví dụ `customer_sentiment`); card `CUSTOM` → id của card.
- `kind` (enum, optional)
  - Allowed values: `SYSTEM`, `CUSTOM`
- `name` (string, optional)
- `valueType` (enum, optional)
  - Allowed values: `BOOLEAN`, `SINGLE_SELECT`, `STRING_LIST`, `RATING`, `TEXT`
- `order` (integer, optional)
- `options` (list of CustomerAiInsightConfigCardsItemsOptionsItems, optional) — Chỉ xuất hiện khi card có danh sách lựa chọn.
- `fromValue` (integer, optional) — Chỉ xuất hiện khi có đặt giá trị.
- `toValue` (integer, optional) — Chỉ xuất hiện khi có đặt giá trị.

### ErrorResponseError

- `code` (string, optional) — Nhóm lỗi (dạng máy đọc được), ổn định theo từng HTTP status.
- `subCode` (string, optional, nullable) — Mã cụ thể, ổn định — dùng để phân nhánh xử lý / dịch i18n. Hãy xử lý logic dựa trên `subCode`, không dựa vào chuỗi `message`.
- `message` (string, optional) — Mô tả cho con người đọc (dùng để debug), không nên dịch trực tiếp.
- `timestamp` (long, optional) — Epoch millis.
- `path` (string, optional) — Đường dẫn request đầy đủ.
- `traceId` (string, optional, nullable) — Mã tương quan request, có khi lỗi đi qua bộ xử lý lỗi chung.
- `details` (list of ErrorResponseErrorDetailsItems, optional, nullable) — Chỉ xuất hiện khi `code` là `VALIDATION_ERROR` — danh sách lỗi theo từng trường.

### CustomerAiInsightConfigCardsItemsOptionsItems

- `optionId` (string, optional)
- `label` (string, optional)
- `order` (integer, optional)

### ErrorResponseErrorDetailsItems

- `field` (string, optional)
- `message` (string, optional)
- `rejectedValue` (any, optional, nullable)

## Examples

**Response**

```json
{
  "enabled": true,
  "modelId": "gpt-4.1-nano",
  "cards": [
    {
      "id": "string",
      "kind": "SYSTEM",
      "name": "string",
      "valueType": "BOOLEAN",
      "order": 1,
      "options": [
        {
          "optionId": "string",
          "label": "string",
          "order": 1
        }
      ],
      "fromValue": 1,
      "toValue": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.omicx.one/customers/ai-insight-config"

headers = {"X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

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

print(response.json())
```

```javascript
const url = 'https://api.omicx.one/customers/ai-insight-config';
const options = {method: 'GET', headers: {'X-Api-Key': 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}};

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.omicx.one/customers/ai-insight-config"

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

	req.Header.Add("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

	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.omicx.one/customers/ai-insight-config")

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

request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

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.omicx.one/customers/ai-insight-config")
  .header("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.omicx.one/customers/ai-insight-config', [
  'headers' => [
    'X-Api-Key' => 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.omicx.one/customers/ai-insight-config");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.omicx.one/customers/ai-insight-config")! 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()
```