Universal AI

Use multiple AI providers via Vercel AI SDK

AI → Generate Text

AI-generated

Summary

Generates text from a prompt or conversation using a selected Google, OpenAI, OpenAI-compatible, DeepSeek, Groq, OpenRouter, or Minimax model. Supports text and file attachments, provider-specific settings, optional caching and custom function tools, and can return results as multiple streamed items.

Inputs

  • Provider and model (required) — Select a provider and model name or ID.
  • Input type (required) — Choose a single prompt or a conversation. For a prompt, provide the required Prompt and optionally a System instruction and attachments. For a conversation, provide one or more role-tagged messages with required content; messages can include attachments. You can instead supply messages as a JSON array, and optionally convert UI messages to ModelMessage format.
  • Attachments — For prompt or assistant/user messages, provide file content as a binary property name, base64 string, or HTTP(S)/data URL, and select a MIME type or specify a custom one. Individual files can be marked for caching.
  • Options — Configure output format, token limit, temperature, sampling, penalties, seed, timeout, stop sequences where shown, retries, request-body inclusion, cache TTL, and Groq reasoning format where supported.
  • Provider-specific settings — Depending on provider, configure OpenAI reasoning and request settings; Google safety, headers, response modalities, thinking, and built-in tools; or custom function tools.
  • Enable Streaming — Stream the response in chunks; the operation outputs multiple items.

Output shape

One or more items containing the generated text and response details; streaming produces multiple items.

The output format can be Simplified (Universal) or OpenAI Compatible. Optional request-body inclusion and provider response formatting affect which additional response fields are present. The source pack provides signatures but omits implementation bodies, so the exact output fields and how caching or custom tools affect execution are not visible.

Links

Discussion