# Ask a financial question

Canonical documentation: https://veripoint.ai/api-docs/ai-financial-research-api

Send one self-contained question. Receive progress, tool results and, in AI mode, a written answer through a Server-Sent Events stream.

## Request

POST https://api.globaldatabase.com/v2/ai/query

This data API uses separately licensed credentials: Authorization: Token YOUR_DATA_API_KEY. It does not accept a Veripoint workspace key.

| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| query | body | string | Yes | One question, up to 4,000 characters. Include the company and country; the API does not retain conversation history. |
| mode | body | "ai" \| "data" | No | Defaults to ai. Use data for raw tool results in the final done event. |

## Example

```curl
curl -N --fail-with-body --request POST 'https://api.globaldatabase.com/v2/ai/query' \
  --header "Authorization: Token $DATA_API_KEY" \
  --header 'Accept: text/event-stream' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "Find company VICAT in FR and show its financials",
  "mode": "ai"
}'
```

## Illustrative response

```text
event: status
data: {"type":"status","message":"Looking up company…"}

event: text
data: {"type":"text","content":"Example answer fragment."}

event: done
data: {"type":"done","tools_used":[],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0},"message_id":null}


```

Illustrative SSE frames. Real requests can contain multiple tool calls and text fragments; the token counts above are placeholders.

- Use Accept: text/event-stream. Even data mode returns SSE, not a single JSON response.
- In data mode, read done.data: an array of { tool, data } objects.
- A successful query consumes an AI-query request. The underlying data tools also have separate product limits. Read X-Quota-* and Retry-After when returned.
- Check both HTTP errors before streaming and error events after HTTP 200. A stream ending without done is incomplete.

Machine-readable reference: https://veripoint.ai/data-openapi.json
