This guide will help you make your first Runtype API call and execute an AI flow.
Let’s verify your API key works by checking your profile:
The /dispatch endpoint is the main way to execute AI flows. Here’s a minimal example:
The inputs field lets you pass variables directly accessible as {{varName}} in templates.
For transient data, inputs provides cleaner syntax than record.metadata. Use record.metadata when you need data to persist with the record in the database.
The dispatch endpoint returns a Server-Sent Events (SSE) stream:
Install our TypeScript SDK for a better developer experience:
The withInputs() method passes data that’s accessible as {{varName}} in your prompts.
This is the recommended approach for passing dynamic data to flows.
Call validate() to check a flow before you run it. It surfaces structural issues, undeclared-variable warnings, and sub-optimal model selections at author time, without creating or executing the flow:
validate() runs against the public validation endpoint and does not consume execution quota. Pass an authenticated client to additionally check that referenced tools, flows, and agents exist in your account — validation.context.accountChecksPerformed reports whether those checks ran.
If you already have a product described as JSON, you can preview and create it through Runtype’s import flow instead of building it step by step.
These flows power /now, “Deploy to Runtype” buttons, and other integrations that hand Runtype a complete product definition.