Docs
Cloudflare
Railway
CodeRabbit
WorkOS
Clerk
Netlify
SerpAPI
OpenRouter
AG Grid
Electric
Prisma
Unkey
Sentry
Cloudflare
Railway
CodeRabbit
WorkOS
Clerk
Netlify
SerpAPI
OpenRouter
AG Grid
Electric
Prisma
Unkey
Sentry
Class References
Function References
Interface References
Type Alias References
Variable References

SchemaInput

Type Alias: SchemaInput

ts
type SchemaInput = 
  | StandardJSONSchemaV1<any, any>
  | StandardSchemaV1<any, any>
  | JSONSchema;
type SchemaInput = 
  | StandardJSONSchemaV1<any, any>
  | StandardSchemaV1<any, any>
  | JSONSchema;

Defined in: packages/ai/src/types.ts:128

Union type for schema input - can be any Standard Schema compliant validator, any Standard JSON Schema compliant schema, or a plain JSONSchema object.

Standard JSON Schema compliant libraries (carry the JSON-schema converter):

  • Zod v4.2+ (natively supports StandardJSONSchemaV1)
  • ArkType v2.1.28+ (natively supports StandardJSONSchemaV1)
  • Valibot v1.2+ (via toStandardJsonSchema() from @valibot/to-json-schema)

StandardSchemaV1 covers libraries whose published types only expose the validator surface — Zod's core $ZodType['~standard'] is currently typed as StandardSchemaV1.Props even though the runtime attaches the jsonSchema converter, so this branch is what makes InferSchemaType recover the inferred type for callers using z.ZodType<T>.

See

https://standardschema.dev/json-schema