Zenlayer icon

Zenlayer

For advanced usage with an AI Gateway from Zenlayer

Actions3

Text → Message a Model

AI-generated

Summary

Send a conversational message to a specified language model provided by Zenlayer and receive the model's response, using either the 'Chat Completions' or 'Responses API' endpoint.

Inputs

  • Model (required) — Select the language model to message either from a searchable list or by directly specifying the model ID.
  • Request Mode (required) — Choose which Zenlayer endpoint to call: 'Chat Completions' (chat) or 'Responses API' (responses).
  • Prompt (required) — Provide one or more messages as input to the model, specifying each message's role (User, Assistant, or System) and content.
  • Options — Configure additional parameters such as background mode settings (for asynchronous execution), instructions (for Responses API), maximum token limit for completions, temperature, top-p sampling, verbosity, response format (text, JSON schema, or JSON object), and whether to store responses on the server (only for Responses API).

Output shape

a single JSON object representing the model's full response from the Zenlayer API

The output JSON varies depending on the selected request mode and response format options. The node calls either the /chat/completions endpoint (for 'chat' mode) or the /responses endpoint (for 'responses' mode) of Zenlayer, reflecting the input prompt and options provided. Response data is returned in full without simplification.

Examples

Example 1: Send a chat message to a language model and get a text completion response.

Set 'Model' to 'gpt-4o', 'Request Mode' to 'chat', provide a series of messages in 'Prompt' with roles and content, and adjust options as desired.

Links

Discussion