> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Completion

Generate a model response.

> [!NOTE]
>
> External Documentation
>
> To learn more, visit the [Gemini documentation](https://ai.google.dev/api/generate-content#method:-models.generatecontent).

## Basic Parameters

| Parameter | Description |
| - | - |
| Content Parts | The content of the current conversation with the model. Example: <pre>`[{  "text": "Write a story about a magic backpack."}]`</pre> |
| Model | The name of the model to use for generating the completion. Example: `models/gemini-2.0-flash` **Note**: Only the latest model versions are supported. |

## Advanced Parameters

| Parameter | Description |
| - | - |
| Cached Content | The name of the content cached to use as context to serve the prediction. Cached content can be only used with model it was created for. Format: `cachedContents/{cachedContent}` For more information about the `Cached Content` parameter, visit [Gemini's API documentation](https://ai.google.dev/gemini-api/docs/caching?lang=rest). |
| Max Output Tokens | The maximum number of tokens to include in a response. |
| Role | The producer of the content. Useful to set for multi-turn conversations. |
| Safety Settings | A list of unique safety setting instances for blocking unsafe content. Example: <pre>`[  {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_ONLY_HIGH"},  {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE"}]`</pre>For more information about the `Safety Settings` parameter, visit [Gemini's API documentation](https://ai.google.dev/gemini-api/docs/safety-settings). |
| Seed | Seed used in decoding. If not set, the request uses a randomly generated seed. |
| Stop Sequences | A comma-separated list of character sequences (up to 5) that will stop output generation. If specified, Gemini will stop at the first appearance of a `Stop Sequence`. The stop sequence will not be included as part of the response. Example: `STOP,END` |
| System Instruction | Developer set system instruction(s). For example: <pre>`{  "parts": {    "text": "You are a cat. Your name is Neko."  },  "contents": {    "parts": {      "text": "Hello there"    }  }}`</pre>For more information about the `System Instruction` parameter, visit [Gemini's API documentation](https://ai.google.dev/gemini-api/docs/text-generation?lang=rest#system-instructions). |
| Temperature | The randomness of the output. Values can range from `0.0` to `2.0`. |
| Tool Config | Tool configuration for any tool specified in the `Tools` parameter. For more information about the `Tool Config` parameter, visit [Gemini's API documentation](https://ai.google.dev/api/caching#ToolConfig). |
| Tools | A list of tools the model may use to generate the next response. For more information about the `Tools` parameter, visit [Gemini's API documentation](https://ai.google.dev/api/caching#Tool). |

## Example Output

```json theme={"dark"}
{
	"candidates": [
		{
			"content": {
				"parts": [
					{
						"text": "Maya hummed, tracing the faded patch on her worn-out backpack. It had been her grandma's, passed down along with stories of adventures"
					}
				],
				"role": "model"
			},
			"finishReason": "MAX_TOKENS",
			"avgLogprobs": -1.2023602803548177
		}
	],
	"usageMetadata": {
		"promptTokenCount": 8,
		"candidatesTokenCount": 30,
		"totalTokenCount": 38,
		"promptTokensDetails": [
			{
				"modality": "TEXT",
				"tokenCount": 8
			}
		]
	},
	"modelVersion": "gemini-2.0-flash-001"
}
```

## Workflow Library Example

[Generate Completion with Gemini and Send Results Via Email](https://library.blinkops.com/workflows/generate-completion-with-gemini-and-send-results-via-email)

![Workflow Library](https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max\&auto=format\&n=ojHYuDeYX5FWuN8a\&q=85\&s=b8af968e71438a9499c3223c9bd29fb2)

Preview this Workflow on desktop

[https://library.blinkops.com/workflows/generate-completion-with-gemini-and-send-results-via-email/canvas](https://library.blinkops.com/workflows/generate-completion-with-gemini-and-send-results-via-email/canvas)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.