← APIs / Talk to PDF API
Verified

Talk to PDF API

ApyHubby ApyHub · Developer Tools

This API lets you ask questions about the content of a pdf and receive accurate, AI-generated answers. Upload a document as a file or provide a publicly accessible URL along with your question, and the API will analyze the document and return a relevant answer. Ideal for extracting specific informat

dataapi
Price per request
$0.08
Base URL
https://gateway.apiosk.com/apyhub-talk-to-pdf-api
Technical Specs
Auth MethodapiKey
Response FormatJSON
Endpoints1
Endpoints
MethodPathDescriptionCost
POST /extract/qna/ask/url Submits a public PDF URL and a natural-language question, then returns a text answer based on the document content.
$0.08 default
View details
Endpoint documentation
POST/extract/qna/ask/url
$0.08 default
Description

Submits a public PDF URL and a natural-language question, then returns a text answer based on the document content.

Documentation

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.

Pricing
$0.08 default
Authentication

Pay per request through Apiosk using x402. Do not send an apy-token; the gateway injects the selected APYHub key server-side.

Request schema
{
  "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"
}
Response schema
{
  "properties": {
    "answer": {
      "type": "string"
    }
  },
  "type": "object"
}
Headers
{
  "properties": {
    "PAYMENT-SIGNATURE": {
      "description": "Signed x402 v2 payment proof. Obtain the payment requirements from the initial HTTP 402 response.",
      "type": "string"
    }
  },
  "required": [],
  "type": "object"
}
Example request
{
  "file_url": "https://assets.apyhub.com/samples/sample.pdf",
  "query": "What is the minimum contrast ratio required for normal text?"
}
Example response
{
  "answer": "The minimum contrast ratio required for normal text is 4.5:1."
}