Submit a consultation image
POST
/ai-doc/pic-resultUI / UX Notice: Do Not Display Recognition Results
The analysis object returned by this endpoint is used by the backend to enrich the consultation context for subsequent summary generation (summary) and report generation (report):
- UI Behavior: Once image analysis completes, do not display the recognition results (
analysis.content, etc.) to the user. - Next Step: After receiving a successful response, proceed directly to
POST /ai-doc/summaryto generate the consultation summary.
Request URL
text
POST https://open-api.habitaxx.com/v1/ms-ai-fast/ai-doc/pic-resultRequest headers
http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/jsonRequest body
json
{
"session_id": "<SESSION_ID>",
"pet_profile_id": 44,
"img_url": "<UPLOAD_RESPONSE_DATA_URL>"
}img_url must be the exact url returned for the current user's successful /oss/images upload. Do not construct a URL or use a third-party URL.
Server-side img_url validation (measured behaviour):
- The URL must be an image asset uploaded by the current user through
/oss/imageswith statusready; unregistered URLs are rejected. - The server re-resolves the hostname and connects directly: private, loopback, link-local addresses and Unix sockets are rejected, and a connection whose actual address differs from the validated one is rejected too.
- Fetch limits: up to
3redirects, remote image size up to20 MiB, and a fetch timeout. - Typical failures:
400withAI_PIC_IMAGE_URL_INVALID,AI_PIC_IMAGE_PRIVATE_ADDRESS_FORBIDDEN,AI_PIC_IMAGE_FETCH_TIMEOUT, orAI_PIC_IMAGE_REDIRECT_LIMIT_EXCEEDED; the public numeric codes are in Error Handling. - The server retries the image recognition automatically; do not retry the same request indefinitely, and note that recognition details are written into the report context.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Smart Consultation session ID. |
img_url | string | Yes | Ready image URL uploaded by the current user. |
pet_profile_id | integer | No | Compatibility field; when provided, it must match the session profile. |
lang | string | No | When provided, it must match the session language. |
Response example
json
{
"code": 200,
"message": "success",
"data": {
"session_id": "<SESSION_ID>",
"report_id": null,
"task": null,
"analysis": {
"content": "{\n \"overall_health_status\": \"健康\",\n \"recg\": {\"photo\": \"非宠物皮肤图片,请检查\"}\n}",
"img_url": "<UPLOAD_RESPONSE_DATA_URL>",
"sub_module_type": 6,
"gateway_request_id": "<REQUEST_ID>"
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
session_id | string | Consultation session ID. |
report_id | integer/null | Related report ID. |
task | object/null | This endpoint returns the recognition result synchronously; normally null, with no polling needed. |
analysis | object | Supplemental image-recognition result. |
analysis.content | string | Recognition text, usually a JSON string (for example recg, result, advice). |
analysis.img_url | string | Image URL used for this recognition. |
analysis.sub_module_type | integer | Recognition type used for this call. |
analysis.gateway_request_id | string/null | Gateway request ID. |
The inner structure of analysis.content is determined by the model (used for server-side context only and should not be displayed on the client UI; the recg field in the example is illustrative only).