> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synapsai.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Question answering

> Extractive, document, table, and visual QA against a deployed model

Use these routes when the launch pipeline is `question-answering`, `document-question-answering`, `table-question-answering`, or `visual-question-answering`. `model` is your deployment id.

## Extractive QA

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import os
import requests

response = requests.post(
    "https://api.synapsai.cloud/v1/question-answering",
    headers={
        "Authorization": f"Bearer {os.environ['SYNAPSAI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "your-model-id",
        "question": "Who wrote the handbook?",
        "context": "The product handbook was written by the platform team.",
    },
)
response.raise_for_status()
print(response.json())
```

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.synapsai.cloud/v1/question-answering \
  -H "Authorization: Bearer $SYNAPSAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-id",
    "question": "Who wrote the handbook?",
    "context": "The product handbook was written by the platform team."
  }'
```

## Document, table, and visual

| Pipeline | Path |
| - | - |
| document-question-answering | `/v1/question-answering/document` |
| table-question-answering | `/v1/question-answering/table` |
| visual-question-answering | `/v1/question-answering/visual` |

Document and visual routes take a question plus a file or image. Table QA sends tabular context with the question. Match the body to the [task](/resources/tasks) you launched.

## Next steps

[Supported tasks](/resources/tasks) · [Integrations](/guides/integrations) · [API overview](/api-reference/introduction)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.