/extract/qna/ask/urlSubmits a public PDF URL and a natural-language question, then returns a text answer based on the document content.
Ask a question about a PDF at a URL
**Method:** POST
**Apiosk URL:** https://gateway.apiosk.com/apyhub-talk-to-pdf-api/extract/qna/ask/url
**Request content type:** application/json
**Response content type:** application/json
What it does
Submits a public PDF URL and a natural-language question, then returns a text answer based on the document content.
Request Body
| Parameter | Type | Mandatory | Description |
| --------- | ---- | --------- | ----------- |
| file_url | String | Yes | Publicly accessible PDF URL. Must be a URI and end in .pdf. |
| query | String | Yes | Natural-language question about the document content. Max length: 2000 characters. |
Response
Returns a JSON object with an answer string field containing the answer to the submitted question.
| Parameter | Type | Mandatory | Description |
| --------- | ---- | --------- | ----------- |
| answer | String | No | The answer to the question. |
Quickstart
Ask a question about a PDF by sending its public URL and your question.
bash
curl -X POST "https://gateway.apiosk.com/apyhub-talk-to-pdf-api/extract/qna/ask/url" \
-H "PAYMENT-SIGNATURE: $PAYMENT_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"file_url": "https://assets.apyhub.com/samples/sample.pdf",
"query": "What is the minimum contrast ratio required for normal text?"
}'
What you'll get back
Returns a JSON object with an answer string field containing the model's response to your question.
json
{
"answer": "The minimum contrast ratio required for normal text is 4.5:1."
}
Payment and authentication
Do not send an apy-token. Apiosk injects the APYHub credential server-side. The first unpaid request returns HTTP 402 Payment Required with a PAYMENT-REQUIRED header. Sign an accepted USDC payment and retry the same request with the proof in PAYMENT-SIGNATURE (or use an Apiosk/x402-aware agent client that performs this exchange automatically).
The $PAYMENT_SIGNATURE placeholder in the example is the signed proof obtained from that initial 402 response.
Source
Parameter definitions and limits were synchronized from [APYHub's official documentation](https://apyhub.com/apyhub/service/ask-question-about-pdf) on 2026-07-18.
Pay per request through Apiosk using x402. Do not send an apy-token; the gateway injects the selected APYHub key server-side.
{
"properties": {
"file_url": {
"description": "Publicly accessible PDF URL. Must end in `.pdf`.",
"example": "https://assets.apyhub.com/samples/sample.pdf",
"format": "uri",
"type": "string"
},
"query": {
"description": "Natural-language question about the document content.",
"example": "What is the minimum contrast ratio required for normal text?",
"maxLength": 2000,
"type": "string"
}
},
"required": [
"file_url",
"query"
],
"type": "object"
}{
"properties": {
"answer": {
"type": "string"
}
},
"type": "object"
}{
"properties": {
"PAYMENT-SIGNATURE": {
"description": "Signed x402 v2 payment proof. Obtain the payment requirements from the initial HTTP 402 response.",
"type": "string"
}
},
"required": [],
"type": "object"
}{
"file_url": "https://assets.apyhub.com/samples/sample.pdf",
"query": "What is the minimum contrast ratio required for normal text?"
}{
"answer": "The minimum contrast ratio required for normal text is 4.5:1."
}