---
title: "M001-2 Formulation agent query"
method: POST
path: "/ai/formulation-agent-query"
tags: ["Formulation Assistant"]
---

# M001-2 Formulation agent query

`POST /ai/formulation-agent-query`

## Request

- Base URL: `https://connect.patsnap.com`
- URL: `https://connect.patsnap.com/ai/formulation-agent-query`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/docs/ai/formulation-agent-query/post.ts> (a function with typed inputs; its response is checked against the schema)

Obtain the task results of the Formulation Agent through the task_id generated by [M001-1]

## Request body

- M0012AiFormulationAgentQueryRequest
  - `task_id` string, required: Task id

## Response `200`

Successful m001-2 formulation agent query response.

- M0012AiFormulationAgentQueryResponse
  - `data` M0012AiFormulationAgentQueryFormulationAgentQueryResponse
    - `status` integer: Task status (1: running, 2: successful, 3: generation exception).
    - `formulations` M0012AiFormulationAgentQueryFormulation[]: Formulation list
      - `dimension` string: Dimension
      - `formulation_1` M0012AiFormulationAgentQueryFormulationDetail
        - `source` string: Source
        - `status` string: Status
        - `name_cn` string: Chinese name
        - `solution_id` string: Solution ID
        - `country_name` string: Country name
        - `solution_type` string: Solution type
        - `ingredient_list` M0012AiFormulationAgentQueryIngredient[]: Ingredient list
          - `content` unknown[]: Content range
            - unknown
          - `function` string: Function
          - `ingredient` string: Ingredient name
      - `formulation_2` M0012AiFormulationAgentQueryFormulationDetail
        - `source` string: Source
        - `status` string: Status
        - `name_cn` string: Chinese name
        - `solution_id` string: Solution ID
        - `country_name` string: Country name
        - `solution_type` string: Solution type
        - `ingredient_list` M0012AiFormulationAgentQueryIngredient[]: Ingredient list
          - `content` unknown[]: Content range
            - unknown
          - `function` string: Function
          - `ingredient` string: Ingredient name
      - `strategy_index` integer: Strategy index
  - `status` boolean, required: Status
  - `error_msg` string: Error Message
  - `error_code` integer, required: Error Code

## Other responses

- `201`: Created.
- `401`: Unauthorized.
- `403`: Forbidden.
- `404`: Not Found.

---

[API](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api.md) - [All operations](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/revisions/c2264a0de595?raw)
