Tài liệu tích hợp

Must1c API tương thích cả chuẩn OpenAI và Anthropic. Chọn công cụ của bạn bên dưới — mỗi CLI, IDE và SDK có hướng dẫn riêng, copy-paste là chạy.

Claude CodeCodex CLIOpenCodeClineCursorRoo CodeContinueOpenAI SDKAnthropic SDK

Bắt đầu nhanh

1. Lấy API key

Tạo key ở mục API Keys. Dạng mk-live-…

2. Đổi base URL

Trỏ tới endpoint của Must1c thay cho OpenAI/Anthropic.

3. Gọi model

Dùng tên model của Must1c, vd gpt-5.5.

Thử ngay với cURL
curl https://htmustc.id.vn/v1/chat/completions \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Endpoints

Chuẩn OpenAI
Base URL
https://htmustc.id.vn/v1

/chat/completions · /completions · /embeddings · /responses · /models · /audio/speech · /audio/transcriptions · /decisions

Chuẩn Anthropic
Base URL
https://htmustc.id.vn

/v1/messages (cho Claude Code & Anthropic SDK)

Tạo ảnh

Tương thích endpoint tạo ảnh của OpenAI. Gửi prompt, nhận về ảnh dạng base64 hoặc URL. Dùng tham số n để tạo nhiều ảnh trong một request.

POST /v1/images/generations

Supported media fields: n (1–4), size, quality and aspect_ratio. Available values still depend on the selected upstream model.

Model đang phục vụ

ModelChất lượngTỉ lệẢnh vàoGiá
gpt-image-2
GPT Image 2
1k · 2k · 3k · 4k1:1 · 4:3 · 3:4 · 3:2 · 2:3 · 4:5 · 5:4 · 16:9 · 9:16 · 21:9 · 9:21 · 2:1 · 1:2tối đa 9$0.1 mỗi ảnh
gpt-image-2.5-flare
GPT Image 2.5 Flare
———$0.1 mỗi ảnh
gpt-image-2.5-sunburst
GPT Image 2.5 Sunburst
———$0.1 mỗi ảnh
grok-imagine-image
Grok Imagine Image
1k · 2k1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 1:2 · 2:1tối đa 9$0.1 mỗi ảnh
grok-imagine-image-2.0
Grok Imagine Image 2.0
———$0.1 mỗi ảnh
nano-banana-2
Nano Banana 2
1k · 2k · 4k16:9 · 9:16 · 1:1 · 4:3 · 3:4—từ $0.16 mỗi ảnh
nano-banana-pro
Nano Banana Pro
1k · 2k · 4k16:9 · 9:16 · 1:1 · 4:3 · 3:4—từ $0.46 mỗi ảnh
seedream_4.5
Seedream 4.5
———$0.1 mỗi ảnh
seedream-5-pro
Seedream 5.0 Pro
———$0.5 mỗi ảnh

Danh sách này đọc thẳng từ cấu hình đang chạy, nên luôn khớp với những gì bạn gọi được lúc này.

Dấu — nghĩa là model đó không nhận tham số này, hoặc chỉ dựng đúng một giá trị nên gửi lên cũng bị bỏ qua.

Bảng giá chi tiết — Nano Banana 2 nano-banana-2
0.5K · $0.161K · $0.232K · $0.354K · $0.52

Giá 1 ảnh theo resolution; n ảnh = giá × n. 2K/4K là bản phóng to từ ảnh gốc 1K.

Bảng giá chi tiết — Nano Banana Pro nano-banana-pro
0.5K · $0.461K · $0.462K · $0.464K · $0.83

Giá 1 ảnh theo resolution; n ảnh = giá × n. 2K/4K là bản phóng to từ ảnh gốc 1K.

Tạo ảnh với cURL
curl https://htmustc.id.vn/v1/images/generations \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A neon city skyline at dusk",
    "n": 1,
    "size": "1024x1024",
    "quality": "high",
    "aspect_ratio": "1:1"
  }'
Cách tính tiền

Model tạo ảnh tính tiền theo credit MỖI ẢNH, không theo token input/output. Mỗi request bị trừ = số ảnh trả về × giá mỗi ảnh của model (nhân với hệ số gói nếu có). Token do upstream báo về không phản ánh chi phí ảnh nên không dùng để tính tiền.

Chi phí = số ảnh (n) × giá mỗi ảnh

Giá mỗi ảnh do admin đặt riêng cho từng model. Nếu một model tạo ảnh chưa đặt giá mỗi ảnh, nó sẽ quay về cách tính theo token.

Sửa ảnh

Sửa một ảnh hoặc ghép nhiều ảnh nguồn. Ảnh nguồn nhận URL công khai hoặc data URI. Không phải model ảnh nào cũng sửa được ảnh — model không hỗ trợ sẽ trả 400 nói rõ.

POST /v1/images/edits

Sửa một ảnh
curl https://htmustc.id.vn/v1/images/edits   -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx"   -H "Content-Type: application/json"   -d '{
    "model": "gpt-image-2",
    "prompt": "Keep the subject unchanged and replace the background with a cinematic neon city",
    "image": "https://example.com/source-image.jpg",
    "n": 1,
    "resolution": "2k",
    "aspect_ratio": "16:9"
  }'
Ghép nhiều ảnh
curl https://htmustc.id.vn/v1/images/edits   -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx"   -H "Content-Type: application/json"   -d '{
    "model": "gpt-image-2",
    "prompt": "Place the person from the first image into the scene from the second image",
    "images": [
      "https://example.com/person.jpg",
      "https://example.com/background.jpg"
    ],
    "resolution": "2k",
    "aspect_ratio": "16:9"
  }'

image nhận một nguồn, images nhận 1–3 nguồn. Đừng gửi cả hai trường trong cùng một request.

Tạo video

Dùng chung endpoint tương thích OpenAI. Tham số nào dùng được là tuỳ model — bảng dưới liệt kê mọi tham số gateway hiểu.

POST /v1/videos

Model đang phục vụ

ModelChất lượngTỉ lệThời lượngBậc (`tier`)Ảnh vàoGiá
gemini-omni-flash
Gemini Omni Flash
720p · 1080p · 4k16:9 · 9:164 · 6 · 8 · 10s——từ $0.69 mỗi clip
gemini-veo-3-1
Gemini Veo 3.1
720p · 1080p · 4k16:9 · 9:164 · 6 · 8slite · fast · quality—từ $0.46 mỗi clip
grok-imagine-video-1.5
Grok imagine video 1.5
—————chưa đặt giá
happyhorse-1.1-i2v
Happyhorse 1.1 I2V
480p · 720p · 1080p———tối đa 1$0.7 mỗi giây

Danh sách này đọc thẳng từ cấu hình đang chạy, nên luôn khớp với những gì bạn gọi được lúc này.

Dấu — nghĩa là model đó không nhận tham số này, hoặc chỉ dựng đúng một giá trị nên gửi lên cũng bị bỏ qua.

Không ghi `tier` thì upstream dùng bậc mặc định của chính nó — không phải bậc rẻ nhất. Với Veo 3.1 đó là `quality`, đắt gấp 10 lần `lite`.

Bảng giá chi tiết — Gemini Omni Flash gemini-omni-flash
tierresolution4s6s8s10s
mặc định720p$0.69$1.04$1.39$1.73
1080p$1.04$1.56$2.08$2.6
4K$2.08$3.12$4.16$5.2

Mỗi ô là giá TRỌN 1 clip (không nhân theo giây) — đúng số tiền bị trừ cho request có tier × resolution × seconds đó. 1080p/4K là bản phóng to từ bản 720p nên chờ lâu hơn vài phút.

Bảng giá chi tiết — Gemini Veo 3.1 gemini-veo-3-1
tierresolution4s6s8s
Lite720p$0.46$0.69$0.92
1080p$0.55$0.83$1.11
4K$1.39$2.08$2.77
Fast720p$0.69$1.04$1.39
1080p$0.83$1.25$1.66
4K$2.08$3.12$4.16
Quality(mặc định)720p$1.04$1.56$2.08
1080p$1.25$1.87$2.5
4K$3.12$4.68$6.24

Mỗi ô là giá TRỌN 1 clip (không nhân theo giây) — đúng số tiền bị trừ cho request có tier × resolution × seconds đó. 1080p/4K là bản phóng to từ bản 720p nên chờ lâu hơn vài phút.

Text → video
curl https://htmustc.id.vn/v1/videos/generations   -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx"   -H "Content-Type: application/json"   -d '{
    "model": "gemini-omni-flash",
    "prompt": "A cinematic aerial shot of a futuristic Ho Chi Minh City at night",
    "seconds": "8",
    "resolution": "1080p",
    "aspect_ratio": "9:16"
  }'
Ảnh → video
curl https://htmustc.id.vn/v1/videos/generations   -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx"   -H "Content-Type: application/json"   -d '{
    "model": "gemini-omni-flash",
    "prompt": "Slow camera push-in, natural wind and cinematic lighting",
    "reference_images": ["https://example.com/source-image.jpg"],
    "seconds": "4",
    "aspect_ratio": "16:9"
  }'
Tham số video
TrườngGiá trịMô tả
modelslugBắt buộc — một slug trong bảng trên
prompttextCảnh, chuyển động, góc máy, phong cách
aspect_ratio16:9 · 9:16 · 1:1 · 4:3 · 3:4Tỉ lệ khung hình; model chỉ nhận tỉ lệ nó dựng được
resolution480p · 720p · 1080p · 4kĐộ phân giải; mức cao hơn đắt hơn — xem bảng giá chi tiết của model
seconds"4" · "6" · "8" · "10"Thời lượng (giây) — chỉ các mức ở cột Thời lượng của model; số khác được quy về mức THẤP hơn gần nhất
tierlite · fast · qualityBậc chất lượng của model nhiều bậc (vd Veo 3.1)
imageURL · data URIẢnh khung đầu — URL, data URI hoặc base64
reference_images[URL, …]1–3 ảnh; số ảnh quyết định chế độ dựng

Tính tiền: model có bảng giá (Veo 3.1, Omni…) trừ đúng giá trọn clip ở ô tier × resolution × seconds (mở “Bảng giá chi tiết” ở trên); model khác: giá mỗi giây × số giây × hệ số độ phân giải × hệ số bậc. Request video có thể mất vài phút.

Nối dài một clip đã dựng

Gửi id mà lần tạo trước trả về. Không cần ghi lại model hay tỉ lệ — cả hai lấy từ chính clip gốc.

POST /v1/videos/extensions
curl https://htmustc.id.vn/v1/videos/extensions \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "video_id": "vid_...",
    "prompt": "the camera keeps pushing in as the light fades"
  }'

Text to Speech (TTS)

Đọc văn bản thành file âm thanh. Endpoint theo chuẩn OpenAI nên dùng được ngay với OpenAI SDK. Kết quả trả về là chính file âm thanh, không phải JSON.

POST /v1/audio/speech

Model đang phục vụ

ModelGiọng (`voice`)Tốc độ (`speed`)Định dạngGiá
aura-2
Aura-2
90 giọng
thalia-en · amalthea-en · andromeda-en …
0.7–1.5×mp3 · wav · aac · opus · flac$0.52 / 1k ký tự
aura-1
Aura-1
12 giọng
asteria-en · angus-en · arcas-en …
cố định 1×mp3 · wav · aac · opus · flac$0.26 / 1k ký tự
eleven_v4
Eleven v4
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$1.39 / 1k ký tự
eleven_v4_turbo
Eleven v4 Turbo
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$0.69 / 1k ký tự
eleven_v3
Eleven v3
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$1.39 / 1k ký tự
eleven_v3_conversational
Eleven v3 Conversational
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$0.69 / 1k ký tự
eleven_multilingual_v2
Eleven Multilingual v2
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$1.39 / 1k ký tự
eleven_flash_v2_5
Eleven Flash v2.5
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$0.69 / 1k ký tự
eleven_turbo_v2_5
Eleven Turbo v2.5
21 giọng
Roger · Sarah · Laura …
0.7–1.2×mp3 · opus$0.69 / 1k ký tự

Danh sách này đọc thẳng từ cấu hình đang chạy, nên luôn khớp với những gì bạn gọi được lúc này.

Dấu — nghĩa là model đó không nhận tham số này, hoặc chỉ dựng đúng một giá trị nên gửi lên cũng bị bỏ qua.

Toàn bộ giọng của aura-2 (90)
thalia-enamalthea-enandromeda-enapollo-enarcas-enaries-enasteria-enathena-enatlas-enaurora-encallista-encora-encordelia-endelia-endraco-enelectra-enharmonia-enhelena-enhera-enhermes-enhyperion-eniris-enjanus-enjuno-enjupiter-enluna-enmars-enminerva-enneptune-enodysseus-enophelia-enorion-enorpheus-enpandora-enphoebe-enpluto-ensaturn-enselene-entheia-envesta-enzeus-enagustina-esalvaro-esantonia-esaquila-escarina-esceleste-esdiana-esestrella-esgloria-esjavier-esluciano-esnestor-esolivia-esselena-essilvia-essirio-esvalerio-esagathe-frhector-fraurelia-deelara-defabian-dejulius-dekara-delara-deviktoria-decesare-itcinzia-itdemetra-itdionisio-itelio-itflavio-itlivia-itmaia-itmelia-itbeatrix-nlcornelia-nldaphne-nlhestia-nllars-nlleda-nlrhea-nlroman-nlsander-nlama-jaebisu-jafujin-jaizanami-jauzume-ja
Toàn bộ giọng của aura-1 (12)
asteria-enangus-enarcas-enathena-enhelios-enhera-enluna-enorion-enorpheus-enperseus-enstella-enzeus-en
Toàn bộ giọng của eleven_v4 (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_v4_turbo (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_v3 (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_v3_conversational (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_multilingual_v2 (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_flash_v2_5 (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
Toàn bộ giọng của eleven_turbo_v2_5 (21)
RogerSarahLauraCharlieGeorgeCallumRiverHarryLiamAliceMatildaWillJessicaEricBellaChrisBrianDanielLilyAdamBill
curl — lưu ra speech.mp3
curl https://htmustc.id.vn/v1/audio/speech \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aura-2",
    "input": "Hello! This is a text-to-speech test.",
    "voice": "thalia-en",
    "speed": 1.1,
    "response_format": "mp3"
  }' \
  --output speech.mp3
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(base_url="https://htmustc.id.vn/v1", api_key="mk-live-xxxxxxxxxxxxxxxxxxxx")

with client.audio.speech.with_streaming_response.create(
    model="aura-2",
    voice="thalia-en",
    input="Hello! This is a text-to-speech test.",
    speed=1.1,
    response_format="mp3",
) as response:
    response.stream_to_file("speech.mp3")
Node.js (OpenAI SDK)
import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://htmustc.id.vn/v1", apiKey: "mk-live-xxxxxxxxxxxxxxxxxxxx" });

const audio = await client.audio.speech.create({
  model: "aura-2",
  voice: "thalia-en",
  input: "Hello! This is a text-to-speech test.",
  speed: 1.1,
  response_format: "mp3",
});
fs.writeFileSync("speech.mp3", Buffer.from(await audio.arrayBuffer()));
Tham số (JSON body)
TrườngGiá trịMô tả
modelslugBắt buộc — một slug trong bảng trên
inputtextBắt buộc — văn bản cần đọc; tính tiền theo số ký tự
voicethalia-enGiọng đọc, dạng <tên>-<ngôn ngữ> (vd thalia-en). Bỏ trống = giọng mặc định của model
speed0.7 – 1.5Tốc độ đọc, mặc định 1. Chỉ model có khoảng tốc độ trong bảng mới chỉnh được; ngoài khoảng sẽ trả 400
response_formatmp3 · wav · aac · opus · flacĐịnh dạng file trả về, mặc định mp3. Chỉ nhận định dạng model đó có

Response: body là file âm thanh, Content-Type khớp định dạng (audio/mpeg, audio/wav, …). Khi lỗi, body là JSON như mọi endpoint khác.

Model Aura đọc tối đa 2.000 ký tự mỗi lượt. Văn bản dài hơn được tự tách đoạn rồi ghép lại khi định dạng là mp3, wav, aac hoặc pcm; với opus và flac, văn bản quá 2.000 ký tự sẽ bị từ chối (400).

Tính tiền: số ký tự của input ÷ 1.000 × giá mỗi 1k ký tự. Giọng, tốc độ và định dạng không làm đổi giá.

Speech to Text (STT)

Chuyển file ghi âm thành văn bản. Gửi dạng multipart/form-data theo chuẩn OpenAI. Chọn verbose_json để nhận thêm mốc thời gian của từng đoạn — đủ để tự dựng phụ đề.

POST /v1/audio/transcriptions · multipart/form-data

Model đang phục vụ

ModelBiến thể (`variant`)Giá
gemini-3.5-transcribe
Gemini 3.5 Transcribe
general (mặc định)$0.06 / phút
nova-3
Nova-3
general (mặc định) · medical · pharma$0.07 / phút
nova-2
Nova-2
general (mặc định) · atc · automotive · conversationalai · drivethru · ea · finance · medical · meeting · phonecall · video · voicemail$0.07 / phút
nova-1
Nova-1
general (mặc định) · drivethru · medical · phonecall · voicemail$0.07 / phút
enhanced
Enhanced
general (mặc định) · automotive · drivethru · finance · meeting · phonecall$0.25 / phút
base
Base
general (mặc định) · conversationalai · finance · meeting · phonecall · phoneme · video · voicemail$0.22 / phút
whisper
Whisper
general (mặc định) · tiny · base · small · medium · large$0.08 / phút
scribe_v2
Scribe v2
general (mặc định)$0.06 / phút

Danh sách này đọc thẳng từ cấu hình đang chạy, nên luôn khớp với những gì bạn gọi được lúc này.

Dấu — nghĩa là model đó không nhận tham số này, hoặc chỉ dựng đúng một giá trị nên gửi lên cũng bị bỏ qua.

curl — bản chép lời
curl https://htmustc.id.vn/v1/audio/transcriptions \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -F model=gemini-3.5-transcribe \
  -F file=@meeting.mp3
curl — mốc thời gian + biến thể
curl https://htmustc.id.vn/v1/audio/transcriptions \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -F model=nova-3 \
  -F file=@meeting.mp3 \
  -F response_format=verbose_json \
  -F variant=medical
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(base_url="https://htmustc.id.vn/v1", api_key="mk-live-xxxxxxxxxxxxxxxxxxxx")

with open("meeting.mp3", "rb") as f:
    result = client.audio.transcriptions.create(
        model="nova-3",
        file=f,
        response_format="verbose_json",
        extra_body={"variant": "medical"},
    )

print(result.text)
for seg in result.segments:
    print(f"{seg.start:.2f}-{seg.end:.2f}  {seg.text}")
Node.js (OpenAI SDK)
import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://htmustc.id.vn/v1", apiKey: "mk-live-xxxxxxxxxxxxxxxxxxxx" });

const result = await client.audio.transcriptions.create({
  model: "nova-3",
  file: fs.createReadStream("meeting.mp3"),
  response_format: "verbose_json",
  variant: "medical",
});
console.log(result.text);

variant không có trong OpenAI SDK: Python truyền qua extra_body, Node.js truyền thẳng vào object — cả hai đều được gửi thành một form field.

Tham số (form fields)
TrườngGiá trịMô tả
file@fileBắt buộc — file âm thanh (mp3, wav, m4a, flac, ogg, webm, mp4…), tối đa 32 MB
modelslugBắt buộc — một slug trong bảng trên
languagevi · en · ja · …Mã ngôn ngữ ISO-639-1 (vi, en, ja…). Bỏ trống = tự nhận diện
prompttextTừ khoá hoặc thuật ngữ cần nhận đúng (tên riêng, tên thuốc, mã sản phẩm…)
response_formatjson · verbose_json · text · srt · vttKiểu kết quả, mặc định json
variantmedicalBản tinh chỉnh theo lĩnh vực của model — xem cột Biến thể. Giá trị model không có sẽ bị từ chối (400) trước khi file được gửi đi
Response — json
{
  "text": "Hello, this is a short test of speech to text.",
  "usage": { "type": "duration", "seconds": 5 }
}
Response — verbose_json
{
  "task": "transcribe",
  "language": "en",
  "duration": 4.48,
  "text": "Hello, this is a short test of speech to text.",
  "segments": [
    { "id": 0, "start": 0, "end": 4.48, "text": "Hello, this is a short test of speech to text." }
  ]
}

text, srt và vtt cũng trả về JSON dạng {"text": "…"}, trong đó trường text chứa nguyên nội dung văn bản / SRT / VTT.

Tính tiền: thời lượng file do upstream đo (làm tròn lên từng giây) × giá mỗi phút ÷ 60.

Ra quyết định — Jev (System One)

Jev của TypeSafe AI không sinh văn bản: bạn gửi một ngữ cảnh (state) và các câu hỏi có kiểu, nhận lại đáp án có kiểu kèm xác suất và độ tin cậy. Hợp với phân loại ticket, định tuyến, chấm điểm, kiểm tra có/không — nhanh và rẻ hơn LLM nhiều lần. Không dùng cho chat hay viết nội dung.

POST /v1/decisions

Chỉ gọi được qua endpoint này; gọi Jev ở /chat/completions sẽ bị từ chối (400).

Model đang phục vụ

ModelNgữ cảnhGiá inputOutput
jev-1.13.0
Jev 1.13.0
64k$0.73 / 1M tokenmiễn phí

Danh sách này đọc thẳng từ cấu hình đang chạy, nên luôn khớp với những gì bạn gọi được lúc này.

curl — ba loại câu hỏi trong một request
curl https://htmustc.id.vn/v1/decisions \
  -H "Authorization: Bearer mk-live-xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-1.13.0",
    "state": "Customer message: My order arrived completely broken and I want my money back today.",
    "questions": {
      "refund": { "type": "noul", "instructions": "Is the customer asking for a refund?" },
      "topic": {
        "type": "choice",
        "instructions": "What is the ticket about?",
        "criteria": {
          "billing": "Payments, refunds, invoices",
          "shipping": "Delivery, damaged or late packages",
          "account": "Login, password, profile"
        }
      },
      "urgency": { "type": "score", "instructions": "How urgent is this ticket?", "criteria": ["low", "medium", "high"] }
    }
  }'
Python (requests)
import requests

resp = requests.post(
    "https://htmustc.id.vn/v1/decisions",
    headers={"Authorization": "Bearer mk-live-xxxxxxxxxxxxxxxxxxxx"},
    json={
        "model": "jev-1.13.0",
        "state": "Customer message: My order arrived completely broken and I want my money back today.",
        "questions": {
            "refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"},
            "urgency": {"type": "score", "instructions": "How urgent is this ticket?",
                        "criteria": ["low", "medium", "high"]},
        },
    },
    timeout=30,
)
resp.raise_for_status()
answers = resp.json()["answers"]
if answers["refund"]["noul"] > 0.8:
    print("refund request, urgency", answers["urgency"]["score"])
Node.js (fetch)
const res = await fetch("https://htmustc.id.vn/v1/decisions", {
  method: "POST",
  headers: { Authorization: "Bearer mk-live-xxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "jev-1.13.0",
    state: "Customer message: My order arrived completely broken and I want my money back today.",
    questions: {
      topic: {
        type: "choice",
        instructions: "What is the ticket about?",
        criteria: { billing: "Payments, refunds", shipping: "Delivery, damage", account: "Login, profile" },
      },
    },
  }),
});
const { answers } = await res.json();
console.log(answers.topic.choice, answers.topic.confidence);

OpenAI SDK không có endpoint này — gọi thẳng bằng HTTP như trên, cùng API key và base URL.

Ba loại câu hỏi
typecriteriaTrả về
noulTuỳ chọn: { "true": "…", "false": "…" } để định nghĩa rõ có/khôngnoul — xác suất câu trả lời là CÓ, từ 0 đến 1
choiceBắt buộc: object 1–255 lựa chọn { "<key>": "<mô tả>" }choice — key được chọn, kèm confidence và probabilities của từng lựa chọn
scoreBắt buộc: mảng 2–10 mức theo thứ tự (chuỗi, hoặc object { label, description })score — điểm có trọng số từ 0 đến (số mức − 1), kèm confidence, probabilities và legend
Tham số (JSON body)
TrườngGiá trịMô tả
modelslugBắt buộc — một slug trong bảng trên
statestring · object · arrayBắt buộc — ngữ cảnh chung mọi câu hỏi cùng xét: chuỗi, object hoặc mảng
questions{ id: question }Bắt buộc — object không rỗng { "<id>": { type, instructions, criteria? } }; id bạn tự đặt và sẽ là key trong answers
…instructionsstring · object · arrayBắt buộc trong mỗi câu hỏi — câu hỏi / hướng dẫn: chuỗi, object hoặc mảng
streamfalseKhông hỗ trợ — bỏ trống hoặc false
Response
{
  "model": "jev-1.13.0",
  "answers": {
    "refund": { "type": "noul", "noul": 0.99 },
    "topic": {
      "type": "choice", "choice": "shipping", "confidence": 0.81,
      "probabilities": { "billing": 0.13, "account": 0.0, "shipping": 0.87 }
    },
    "urgency": {
      "type": "score", "score": 1.99, "confidence": 0.99,
      "legend": { "0": "low", "1": "medium", "2": "high" },
      "probabilities": { "0": 0.0, "1": 0.0, "2": 1.0 }
    }
  },
  "usage": { "input_tokens": 399, "output_tokens": 69 }
}

Giới hạn: tối đa 64k token mỗi request, trong đó state cộng câu hỏi dài nhất không quá 32k. Input nên là tiếng Anh; ngôn ngữ khác vẫn chạy nhưng nên tự đánh giá trên dữ liệu của bạn.

Body sai trả 400 invalid_decision_request, kèm đúng trường bị sai (vd questions.topic.criteria). Gọi Jev ở endpoint khác trả 400 model_not_supported_on_endpoint.

Jev trả về tín hiệu; hành động là việc của code bạn. Đừng để một đáp án tự xoá dữ liệu, thanh toán hay đăng nội dung mà không qua bước kiểm tra quyền của chính ứng dụng.

Tính tiền: input_tokens do upstream đếm ÷ 1.000.000 × giá input. Output miễn phí. Số token input gồm state, các câu hỏi và một phần khung cố định (~250 token mỗi request).

CLI

Claude Code

Claude Code

CLI

Anthropic-compatible — trỏ ANTHROPIC_BASE_URL là chạy qua proxy

  1. 1Tạo API key trong mục API Keys.
  2. 2Đặt 3 biến môi trường bên cạnh (chọn tab theo HĐH).
  3. 3Chạy `claude` như bình thường — token & chi phí được đo qua gateway.
macOS / Linux
# macOS / Linux — trỏ Claude Code qua proxy
export ANTHROPIC_BASE_URL="https://htmustc.id.vn"
export ANTHROPIC_AUTH_TOKEN="mk-live-xxxxxxxxxxxxxxxxxxxx"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4.6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4.8"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4.5"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"

claude
Model phải được map tới pool entry provider Anthropic trong Admin.
CLI

Codex CLI

Codex CLI

CLI

OpenAI Responses API — khai báo model_provider với wire_api = responses

  1. 1Tạo API key trong mục API Keys.
  2. 2Mở ~/.codex/config.toml và thêm provider must1c như bên cạnh.
  3. 3Đặt biến môi trường MUST1C_API_KEY rồi chạy `codex`.
config.toml
# ~/.codex/config.toml
model = "gpt-5.5"
model_provider = "must1c"

[model_providers.must1c]
name = "Must1c"
base_url = "https://htmustc.id.vn/v1"
env_key = "MUST1C_API_KEY"
wire_api = "responses"
Model phải map tới pool entry hỗ trợ /v1/responses (OpenAI-compatible) trong Admin.
CLI

OpenCode

OpenCode

CLI

Khai báo Must1c làm provider OpenAI-compatible tùy chỉnh

  1. 1Mở file cấu hình ~/.config/opencode/opencode.json.
  2. 2Thêm provider must1c như bên cạnh.
  3. 3Chọn model trong OpenCode.
opencode.json
// ~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "must1c": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Must1c",
      "options": {
        "baseURL": "https://htmustc.id.vn/v1",
        "apiKey": "mk-live-xxxxxxxxxxxxxxxxxxxx"
      },
      "models": {
        "gpt-5.5": { "name": "gpt-5.5" },
        "claude-opus-5-5": { "name": "claude-opus-4.8" }
      }
    }
  }
}
IDE Extension

Cline

Cline

IDE Extension

VS Code extension — chế độ OpenAI Compatible

  1. 1Mở Cline → biểu tượng Settings.
  2. 2Chọn API Provider = OpenAI Compatible.
  3. 3Điền các trường như bên cạnh rồi lưu.
Cấu hình
API Provider:  OpenAI Compatible
Base URL:      https://htmustc.id.vn/v1
API Key:       mk-live-xxxxxxxxxxxxxxxxxxxx
Model ID:      gpt-5.5
IDE Extension

Cursor

Cursor

IDE Extension

Override Base URL trong Settings → Models

  1. 1Vào Settings → Models.
  2. 2Bật Override OpenAI Base URL và dán base URL.
  3. 3Thêm model vào danh sách.
Cấu hình
Settings → Models → OpenAI API Key
  • API Key:            mk-live-xxxxxxxxxxxxxxxxxxxx
  • Override Base URL:  https://htmustc.id.vn/v1
  • Thêm model:         gpt-5.5
Cursor yêu cầu API key OpenAI hợp lệ về định dạng — key Must1c đáp ứng được.
IDE Extension

Roo Code

Roo Code

IDE Extension

VS Code — tương tự Cline, chế độ OpenAI Compatible

  1. 1Mở Roo Code → Settings.
  2. 2API Provider = OpenAI Compatible.
  3. 3Điền base URL, key và model.
Cấu hình
API Provider:  OpenAI Compatible
Base URL:      https://htmustc.id.vn/v1
API Key:       mk-live-xxxxxxxxxxxxxxxxxxxx
Model:         gpt-5.5
IDE Extension

Continue

Continue

IDE Extension

VS Code / JetBrains — khai báo trong config.yaml

  1. 1Mở ~/.continue/config.yaml.
  2. 2Thêm block models như bên cạnh.
  3. 3Chọn "Must1c GPT-4o" trong thanh model của Continue.
config.yaml
# ~/.continue/config.yaml
models:
  - name: GPT 5.5
    provider: openai
    model: gpt-5.5
    apiBase: https://htmustc.id.vn/v1
    apiKey: mk-live-xxxxxxxxxxxxxxxxxxxx
SDK

OpenAI SDK

OpenAI SDK

SDK

Python & Node — chỉ đổi base_url

Python
from openai import OpenAI

client = OpenAI(
    api_key="mk-live-xxxxxxxxxxxxxxxxxxxx",
    base_url="https://htmustc.id.vn/v1",  # đổi từ OpenAI sang Must1c
)

resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Xin chào!"}],
)
print(resp.choices[0].message.content)
SDK

Anthropic SDK

Anthropic SDK

SDK

Đặt base_url về gateway, dùng /v1/messages

Python
from anthropic import Anthropic

client = Anthropic(
    api_key="mk-live-xxxxxxxxxxxxxxxxxxxx",
    base_url="https://htmustc.id.vn",  # trỏ về Must1c
)

msg = client.messages.create(
    model="claude-opus-4.8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Xin chào!"}],
)
print(msg.content[0].text)

Mã lỗi

HTTPLoại lỗiMô tả
400invalid_request_errorYêu cầu sai định dạng hoặc thiếu tham số.
401authentication_errorAPI key không hợp lệ hoặc đã bị thu hồi.
403permission_errorKey không có quyền truy cập tài nguyên này.
402insufficient_quotaSố dư ví không đủ để thực hiện request.
429rate_limit_errorVượt quá giới hạn tần suất (xem header Retry-After).
500api_errorLỗi nội bộ của gateway.
502api_errorLỗi từ nhà cung cấp upstream.

Cần hỗ trợ? Liên hệ support@must1c.api.