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

# Process Query Async

`POST /process_query_async`

## Request

- The document declares no server URL.
- Auth: none declared
- TypeScript: <https://skmtc.dev/gptstonks/apis/gptstonks-chat-ce-api/docs/process_query_async/post.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/gptstonks/apis/gptstonks-chat-ce-api.md) - [All operations](https://skmtc.dev/gptstonks/apis/gptstonks-chat-ce-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gptstonks/apis/gptstonks-chat-ce-api/revisions/a0df966837f8?raw)
