ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Gemini -> Generate Content
Readonly
Gemini → Generate Content

Action summary

Gemini -> Generate Content

Xano / Google Gemini

Gemini → Generate Content

Overview

This action lets you generate text or general AI content using the Gemini API. You specify the model name and a prompt, then the function sends this request to Gemini and returns the generated response.

Inputs

Name Type Required Description
gemini_api_key text (registry) Yes Your Gemini API key from the settings registry.
model text Yes The Gemini model to use (e.g., gemini-1.5-flash).
prompt text Yes The prompt or question for Gemini to generate content for.

Function Stack

  1. Gemini API Request
    • Sends a POST request to:
https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={gemini_api_key}
- The body of the request includes the user-supplied `prompt`.
- The response is saved as `gemini_api`.
  1. Precondition
    • Verifies the API response status is 200 to ensure the request succeeded.
  2. Response
    • Returns the content from gemini_api.response.result.

Example Usage

Request

{
  "gemini_api_key": "AIzaSyD...",
  "model": "gemini-1.5-flash",
  "prompt": "Summarize the latest research trends in artificial intelligence."
}

Response

{
  "result": "Recent AI research trends include improvements in large language models, multimodal AI, edge computing integration, AI safety efforts, and reinforcement learning advancements."
}

Notes

  • Select a valid Gemini model name for your use case.
  • The gemini_api_key must have the appropriate access and quota.
  • The prompt should be clear for best results from the model.
  • For more advanced outputs (code, lists, summaries, etc.), craft your prompt accordingly.

Troubleshooting

  • PERMISSION_DENIED or INVALID_ARGUMENT: Check if your API key and model name are correct and supported.
  • Empty or incomplete response: Revise the prompt or try a different model.
  • Other errors: Consult the Gemini API documentation for troubleshooting and more usage instructions.

References

  • Gemini API: Documentation \& Models
  • Gemini API: Overview

Version notes

Initial version
Current
2025-06-30T11:09:30.000+00:00