跳转到主要内容
POST
/
augment
/
text-parser
/api/v1/augment/text-parser
curl --request POST \
  --url https://api.venice.ai/api/v1/augment/text-parser \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form response_format=json
{
  "text": "<string>",
  "tokens": 123
}
这是一个实验性 API。请求和响应格式可能会在不另行通知的情况下变更。
通过 multipart/form-data 的 file 字段上传文档文件。支持的格式包括 PDFDOCXXLSX纯文本文件(最大 25MB)。 response_format 设置为 json(默认)可获取包含已提取文本和 token 数量的结构化输出,设置为 text 则返回原始提取的文本。 隐私: 文本解析完全在 Venice 基础设施的内存中运行,零数据保留。您的文档在处理后立即被丢弃 —— 不存储或记录任何内容。 定价: 每次请求 $0.01。

示例(cURL)

curl -X POST https://api.venice.ai/api/v1/augment/text-parser \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -F "[email protected]" \
  -F "response_format=json"

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

multipart/form-data
file
file
必填

The document file to parse. Supported formats: PDF, DOCX, PPTX, XLSX, and plain text files. Maximum size: 25MB.

response_format
enum<string>
默认值:json

The format of the response output. "json" returns structured JSON with text and token count, "text" returns only the extracted text.

可用选项:
json,
text

响应

Text extraction completed successfully

Text parser response containing extracted text and token count.

text
string
必填

The extracted text content from the document.

tokens
number
必填

The token count of the extracted text.