You can access hosted professional AI models via the iztro Chat API. These models automatically call backend astrological tools so you don't have to manage prompts or manual charting.
Available Models
iztro-ziwei-v3: Best for personality, life patterns, compatibility, and long-term trends (Great Limit, Annual, etc.). Requires birth date, time, gender, and topic.iztro-qimen-v3: Best for specific decision-making (negotiations, interviews, etc.). Requires context, a specific question, and the time of inquiry. Does not require birth information.
Integration Pattern
It is recommended to use the multi-turn conversation API: first create a session, then send messages to that session. The API handles context automatically.
Note: Always store your ZIWEI_API_KEY in a server-side environment variable. Never include it in client-side/browser code.
Example: Create a Ziwei Session and Send a Message
# 1. Create a session
curl https://chat-api.iztro.com/v2/platform/sessions \
-H "Authorization: Bearer $ZIWEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_user_id": "user_123",
"model": "iztro-ziwei-v3",
"system_prompt_override": "用简洁中文回答,避免过度术语,并在最后给出可继续追问的方向。"
}'
# 2. Send a message to the session (replace {session_id} with the ID from step 1)
curl https://chat-api.iztro.com/v2/platform/sessions/{session_id}/messages \
-H "Authorization: Bearer $ZIWEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "分析我的 2026 年事业趋势。生日是 1995-02-23,出生时辰 17 点,性别女。",
"title": "2026 事业解读",
"language": "zh",
"enable_iztro_call": true
}'
Example: Create a Qimen Session
For Qimen, it is recommended to pass current_datetime with a UTC offset to ensure reproducible results.
# 1. Create a session
curl https://chat-api.iztro.com/v2/platform/sessions \
-H "Authorization: Bearer $ZIWEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_user_id": "user_123",
"model": "iztro-qimen-v3"
}'
# 2. Send a message
curl https://chat-api.iztro.com/v2/platform/sessions/{session_id}/messages \
-H "Authorization: Bearer $ZIWEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "我们已经谈过两次渠道合作,但分成和上线时间还没定。现在应该推进、继续谈,还是暂缓?如果可以推进,请给出最近的行动窗口。",
"current_datetime": "2026-07-20T14:30:00+08:00",
"language": "zh",
"enable_iztro_call": true
}'