---
title: "Process Query Async"
method: POST
path: "/process_query_async"
---

# Process Query Async

`POST /process_query_async`

Asynchronous endpoint to start processing the given query. The processing runs in the
background and the result is eventually returned.

Args:
    request (`Request`): FastAPI request object containing the query to be processed.
    query_in (`QueryIn`): validated query by the user.

Returns:
    `BaseAgentResponse | DataAgentResponse`: the standard response by the API.

## Request body

- QueryIn — Model to define the main query parameters.
  - `query` string, required

## Response `200`

Successful Response

- union
  - BaseAgentResponse — Model to define the base response parameters.
    - `type` string, required
    - `body` string, required
  - DataAgentResponse — Model to define the data response parameters.
    - `type` string, required
    - `body` string, required
    - `result_data` object[], required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/gptstonks/apis/gptstonks-chat-ce-api.md) · [All operations](https://skmtc.net/gptstonks/apis/gptstonks-chat-ce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gptstonks/gptstonks-chat-ce-api/revisions/a0df966837f8/schema)
