Structured output
Get typed data back from a run instead of text.
Pass a schema in output and the run returns data that matches it in run.output. The schema takes a Standard Schema, such as Zod, so run.output is fully typed.
Coming Q4 2026
The SDK ships with AxAgent. The API below may change before launch.
Example: read an invoice
import fs from 'node:fs'
import Axerity from '@axerity/sdk'
import { z } from 'zod'
const axerity = new Axerity()
const file = await axerity.files.upload({
file: fs.createReadStream('invoice.pdf'),
})
const run = await axerity.runs.create({
agent: agent.id,
input: 'Read the attached invoice',
files: [file.id],
output: z.object({
vendor: z.string(),
total: z.number(),
dueDate: z.string(),
}),
})
// Typed as { vendor: string; total: number; dueDate: string }
console.log(run.output.total)text and output
| Field | When it is set |
|---|---|
run.text | Every run |
run.output | Runs that pass an output schema |