Branch #02 docs/api/02-llm-tools.md

04. LLM Tools (OCR & Transcribe)

Branch #02 — Trích xuất dữ liệu từ tài liệu, ảnh, âm thanh, video.

Endpoints

POST
https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr

OCR từ ảnh/tài liệu

Auth: Bearer

POST
https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe

Chuyển giọng nói thành text

Auth: Bearer

GET
https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr/health

Health OCR

Auth: Public

GET
https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe/health

Health transcribe

Auth: Public

Method Path Auth Mô tả
POST https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr Bearer OCR từ ảnh/tài liệu
POST https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe Bearer Chuyển giọng nói thành text
GET https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr/health Public Health OCR
GET https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe/health Public Health transcribe

Query Examples

POST OCR từ ảnh/tài liệu
curl -X POST "https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr" -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d '{"sample":true}'
const res = await fetch('https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"sample":true}),
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr"
headers = {'Authorization': 'Bearer biz-YOUR_KEY', 'Content-Type': 'application/json'}
payload = '{"sample":true}'
res = requests.request("POST", url, headers=headers, data=payload)
print(res.json())
POST Chuyển giọng nói thành text
curl -X POST "https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe" -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d '{"sample":true}'
const res = await fetch('https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"sample":true}),
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe"
headers = {'Authorization': 'Bearer biz-YOUR_KEY', 'Content-Type': 'application/json'}
payload = '{"sample":true}'
res = requests.request("POST", url, headers=headers, data=payload)
print(res.json())
GET Health OCR
curl -X GET "https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr/health"
const res = await fetch('https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr/health', {
  method: 'GET',
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr/health"
headers = {}
res = requests.get(url, headers=headers)
print(res.json())
GET Health transcribe
curl -X GET "https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe/health"
const res = await fetch('https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe/health', {
  method: 'GET',
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/bizcity/v1/tools/transcribe/health"
headers = {}
res = requests.get(url, headers=headers)
print(res.json())

Use Cases

  • Số hóa hóa đơn/chứng từ vào CRM hoặc POS.
  • Trích transcript cuộc họp để làm knowledge base nội bộ.
  • Tạo dữ liệu đầu vào cho automation phân loại công việc.

Implementation Steps

  1. Gửi URL ảnh hoặc file hợp lệ tới OCR endpoint.
  2. Chuẩn hóa output thành schema nội bộ trước khi lưu DB.
  3. Đánh nhãn dữ liệu để feed vào KG hoặc vector store.

Quick Start cURL

bash
curl -X POST https://bizgpt.vn/wp-json/bizcity/v1/tools/ocr -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d "{\"image_url\":\"https://example.com/invoice.jpg\",\"lang\":\"vi\"}"
Canonical Spec

docs/api/02-llm-tools.md