Media Generation
Generate Document
Generate PDF, DOCX, PPTX, XLSX, or CSV documents from natural language.
POST
Generate Document
Generate structured documents from a natural language prompt. Supports PDF, DOCX, PPTX, XLSX, and CSV formats.
Authentication
Requires a Bearer token. See Authentication.Request Body
Description of the document to generate.
Output format. One of:
pdf, docx, pptx, xlsx, csv.Request Examples
Response
Unique document ID (prefixed
doc_).ISO 8601 timestamp.
The output format (e.g.,
"pdf").Auto-generated document title.
Presigned URL to download the document file. May be
null if file generation is still processing.File size in bytes.
Text content of the generated document.
Example Response
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_prompt | prompt is required |
| 400 | invalid_format | Unsupported format. Supported: pdf, docx, pptx, xlsx, csv |
| 401 | invalid_api_key | Missing or invalid API key |
| 429 | rate_limit_exceeded | Too many requests |
Generate Document
