Skip to content

Submit a consultation image ​

POST/ai-doc/pic-result

UI / 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/summary to generate the consultation summary.

Request URL ​

text
POST https://open-api.habitaxx.com/v1/ms-ai-fast/ai-doc/pic-result

Request headers ​

http
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

Request 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/images with status ready; 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 3 redirects, remote image size up to 20 MiB, and a fetch timeout.
  • Typical failures: 400 with AI_PIC_IMAGE_URL_INVALID, AI_PIC_IMAGE_PRIVATE_ADDRESS_FORBIDDEN, AI_PIC_IMAGE_FETCH_TIMEOUT, or AI_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 ​

FieldTypeRequiredDescription
session_idstringYesSmart Consultation session ID.
img_urlstringYesReady image URL uploaded by the current user.
pet_profile_idintegerNoCompatibility field; when provided, it must match the session profile.
langstringNoWhen 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 ​

FieldTypeDescription
session_idstringConsultation session ID.
report_idinteger/nullRelated report ID.
taskobject/nullThis endpoint returns the recognition result synchronously; normally null, with no polling needed.
analysisobjectSupplemental image-recognition result.
analysis.contentstringRecognition text, usually a JSON string (for example recg, result, advice).
analysis.img_urlstringImage URL used for this recognition.
analysis.sub_module_typeintegerRecognition type used for this call.
analysis.gateway_request_idstring/nullGateway 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).

最近更新

Qijie Open Platform · API Documentation