API
openai("gpt-5") from @ai-sdk/openai.
OpenAI Codex
In~/.codex/config.toml:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Generate Word, PowerPoint, Excel and PDF files from an agent with the OpenAI API (function calling) and in OpenAI Codex.
npm install openai @doconda/sdk
import OpenAI from "openai"
import { Doconda } from "@doconda/sdk"
const openai = new OpenAI()
const docondaTools = new Doconda().tools()
const tools = docondaTools.map((t) => ({ type: "function" as const, function: { name: t.name, description: t.description, parameters: t.inputSchema } }))
const messages: any[] = [{ role: "user", content: "Write a memo for the team: the office is closed on Friday" }]
while (true) {
const res = await openai.chat.completions.create({ model: "gpt-5", messages, tools })
const message = res.choices[0]?.message
if (!message) break
messages.push(message)
if (!message.tool_calls?.length) break
for (const call of message.tool_calls) {
if (call.type !== "function") continue
const result = await docondaTools.find((t) => t.name === call.function.name)!.run(JSON.parse(call.function.arguments))
messages.push({ role: "tool", tool_call_id: call.id, content: JSON.stringify(result) })
}
}
openai("gpt-5") from @ai-sdk/openai.
~/.codex/config.toml:
[mcp_servers.doconda]
command = "npx"
args = ["-y", "@doconda/mcp"]
env = { DOCONDA_API_KEY = "ak_eu_…" }