@doconda/sdk
Convert, generate and edit Word (DOCX), PowerPoint (PPTX), Excel (XLSX) and PDF documents from your AI agent or chatbot, with one API call. Editable files with real Word styles, reviewed before they are delivered.
Use it when your agent has to hand the user a document and you don't want to maintain python-docx, docx.js, pptxgenjs or templates. Works with the Vercel AI SDK, OpenAI, Azure OpenAI, Claude, Amazon Bedrock, Vertex AI, Gemini, Mistral, LangChain, Mastra and any model with tool calling.
npm install @doconda/sdk
import { Doconda } from "@doconda/sdk"
const doconda = new Doconda() // reads DOCONDA_API_KEY
const doc = await doconda.documents.create({ format: "docx", prompt: "Report on the housing law" })
console.log(doc.outputs) // links to the Word file and the PDF
Error messages and report texts come in English. For Spanish, pass new Doconda({ language: "es" }) (sent as
Accept-Language). Codes (e.code) never change with the language.
Any file into another format, with no AI: PDF, Word, PowerPoint, Excel or a picture to Markdown for your model,
Markdown to Word, Word to PDF… Free up to 1,000 conversions a month, then €0.01 each. It takes a local path, a URL,
bytes or a file_… id:
const { text } = await doconda.convert("proposal.pdf", "md") // a file on this machine
const { output } = await doconda.convert("notes.md", "docx") // output.url: the Word file, for 5 minutes
As tools for your agent
doconda.tools() returns ready-made tools (name, description, JSON Schema, run) to convert, create and edit documents.
If the API answers with an error, run doesn't throw: it returns { error: "<code>", message, fields? } so the model
can act on it.
import { anthropic } from "@ai-sdk/anthropic"
import { generateText, isStepCount, jsonSchema, tool } from "ai"
import { Doconda } from "@doconda/sdk"
const tools = Object.fromEntries(
new Doconda().tools().map((t) => [
t.name,
tool({ description: t.description, inputSchema: jsonSchema(t.inputSchema), execute: (input) => t.run(input as Record<string, unknown>) }),
]),
)
await generateText({
model: anthropic("claude-sonnet-5-5"),
tools,
stopWhen: isStepCount(5),
prompt: "Create a 5-slide deck on our quarterly results",
})
Why Doconda
- Editable files: real Word styles, slide layouts and Excel formulas, not images or HTML exports.
- Checked before delivery: the agent checks every file and fixes what it finds before handing it over.
- Always a PDF and a preview of each page, ready to show in your chat UI.
- Works with any model that calls tools, and runs in the EU.
Examples
- Excel from an Amazon Bedrock agent
- A Vercel AI SDK chatbot that returns a Word file
- PowerPoint from Gemini on Vertex AI
- Convert files
- More, one per stack (Bedrock, Vertex AI, Azure OpenAI, OpenAI, Claude, LangGraph, Strands, Mastra): B-C-Software/doconda-examples
Also in Python: doconda · Guides for every stack: https://docs.doconda.com/agents/introduction · MCP server: @doconda/mcp · Get an API key: https://doconda.com