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

# PDFMathTranslate Next

> Learn how to configure PDFMathTranslate Next with ScitiX Model Inference for layout-preserving PDF translation workflows.

[PDFMathTranslate Next](https://github.com/PDFMathTranslate/PDFMathTranslate-next) (`pdf2zh-next`) translates PDFs while preserving layout, formulas, tables, and figures. Its **OpenAI Compatible** engine targets any OpenAI-compatible endpoint, so it runs on the ScitiX Model Inference API.

Default model here is `glm-5.2`; see the [Models](https://console.scitix.ai/model-inference/models) page for the full list and pricing.

## Configure

Install the CLI (`pip install pdf2zh-next`), create an API key on the ScitiX [API Keys](https://console.scitix.ai/model-inference/api_keys) page, then select the **OpenAI Compatible** engine and point it at ScitiX:

```bash theme={null}
pdf2zh_next \
  --openaicompatible \
  --openai-compatible-model glm-5.2 \
  --openai-compatible-base-url https://api.scitix.ai/model-api/v1 \
  --openai-compatible-api-key "<Your API Key>" \
  --lang-in en --lang-out zh \
  input.pdf
```

| Flag                           | Value                                                                                                     |
| ------------------------------ | --------------------------------------------------------------------------------------------------------- |
| `--openaicompatible`           | Select the OpenAI-compatible engine; use this instead of `--openai` for third-party endpoints like ScitiX |
| `--openai-compatible-model`    | ScitiX model ID, e.g. `glm-5.2`                                                                           |
| `--openai-compatible-base-url` | ScitiX OpenAI-compatible endpoint: `https://api.scitix.ai/model-api/v1`                                   |
| `--openai-compatible-api-key`  | Your ScitiX API key                                                                                       |
| `--lang-in` / `--lang-out`     | Source / target language codes, e.g. `en` → `zh`                                                          |

Formulas, tables, and figures are preserved by design — only text runs are translated. Use `--qps` to bound request rate, and `--pages` (e.g. `1-5`) to translate a subset.

## Verify

Translate a page — it writes a monolingual and a bilingual PDF, and prints token usage confirming the requests reached ScitiX:

```bash theme={null}
pdf2zh_next --openaicompatible \
  --openai-compatible-model glm-5.2 \
  --openai-compatible-base-url https://api.scitix.ai/model-api/v1 \
  --openai-compatible-api-key "<Your API Key>" \
  --lang-in en --lang-out zh --pages 1 --output out/ input.pdf

# → out/input.zh.mono.pdf , out/input.zh.dual.pdf
# → Total Token Usage: Total 4022, Prompt 1246, Completion 2776
```

The translated PDF carries the target-language text while math is left intact — e.g. `a^2 + b^2 = c^2` stays as-is in the output.

Verified on pdf2zh-next 2.9.0 (BabelDOC 0.6.2).
