> This page is for Glide Classic.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.glideapps.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.glideapps.com/docs/_mcp/server.

# OpenRouter

> Generate text using popular AI models through OpenRouter.

[OpenRouter](https://openrouter.ai/) is a unified API that provides access to multiple AI models from providers like Anthropic, Google, OpenAI, Meta, Mistral, and DeepSeek. The OpenRouter integration allows you to generate text using these models directly in your Glide apps.

> **Paid Plan Required**
>
> A paid plan is required to use this feature. [Check out our pricing to find the right plan for you. ](https://www.glideapps.com/pricing)

## **Adding the OpenRouter Integration**

#### OpenRouter: Adding the Integration

You'll need to create an account on [OpenRouter](https://openrouter.ai/) if you haven't already.

In OpenRouter, head to the API keys page and create a new API key. **Once you close the key window, you cannot view the key again.** Save this key in a safe place.

In your Glide app, click the [Settings](/docs/getting-started/app-settings) icon in the upper-right corner.

Navigate to the [Integrations](/docs/automation/integrations) tab and select OpenRouter.

Click the **Add** button.

Copy-paste the OpenRouter API key to finish configuring the integration. It will save automatically.

## **Using the Generate Text Action**

The **Generate Text** action sends a message to any model available on OpenRouter and returns the AI-generated response.

The action can be added to a [Component](/docs/essentials/components) that supports Actions (e.g., a [Button component](/docs/essentials/components/button)), added to a workflow in the [Workflow Editor](/docs/getting-started/introduction-to-workflows#the-workflow-editor), or in the [Data Editor](/docs/getting-started/introduction-to-the-data-editor) as a [Computed Column](/docs/automation/computed-columns).

#### Data Editor

#### OpenRouter: In the Data Editor

Open the table where you want to use the **Generate Text** action.

Add a new column by clicking the (**+**) plus symbol to the right of the table.

* New columns added with the plus button will always appear on the right. If you'd like to add a column somewhere else in your data, you can select the dropdown menu on an existing column and choose **Add column right.** You can also click and drag columns to rearrange them.

Name your column.

Search for **OpenRouter** or navigate to **Integrations → OpenRouter → Generate Text.**

Configure the **Message** field with the prompt or question you want the AI to respond to.

Select a **Model**.

Select **Save**.

#### Layout Editor

#### OpenRouter: In the Layout Editor

If you have not already, create a text column in the Data Editor to store OpenRouter’s results.

Add a component that supports actions such as [Button](/docs/essentials/components/button), [Hint](/docs/essentials/components/hint), or [Rich Text](/docs/essentials/components/rich-text).

In the configuration panel on the right, in the **Actions** menu, search for the **OpenRouter&#xA0;**→**&#x20;Generate text** action.

Name the action and choose an icon.

Configure the **Message** field with the prompt or question you want the AI to respond to.

Select a **Model**.

Choose the column you prepared to store the AI's response.

Click away to save your configuration.

#### Workflow Editor

#### OpenRouter: In the Workflow Editor

Select the (**+**) plus symbol or the **+ New Workflow** button.

Select the data source for the table where the action is triggered. This may need to be inside of a Loop, depending on your trigger type.

Search for the **OpenRouter&#x20;**→**&#x20;Generate text** action.

Configure the **Message** field with the prompt or question you want the AI to respond to.

Select a **Model** from the dropdown.

Choose the column you prepared to store the OpenRouter’s response.

Click away to save your configuration.

## **Advanced Settings for Generate Text**

There are a variety of advanced settings that can be adjusted for the Generate Text action.

**Custom Model ID** allows you to specify a model using its OpenRouter identifier (e.g., anthropic/claude-3.7-sonnet:thinking).

**System Prompt** provides instructions that guide the AI's behavior and tone.

**Max Tokens** controls the maximum length of the generated response.

**Temperature** controls response creativity. Lower values make the output more focused, while higher values make it more creative.

**Top P** is an alternative way to control response randomness.

## **Rate Limits**

OpenRouter has rate limits that vary based on your account tier and the specific model being used. These limits apply when using OpenRouter through Glide. [Learn more about OpenRouter rate limits.](https://openrouter.ai/docs/api/reference/limits)

To learn more generally about Integrations in Glide, including how they affect your app’s usage, check out our [Introduction to Integrations](/docs/automation/integrations).

## Frequently Asked Questions

#### Don't see the OpenRouter integration?

You may need to upgrade your plan. [Browse Glide's plans and find the right fit for you.](https://www.glideapps.com/pricing)

#### Which model should I use?

OpenRouter provides access to hundreds of models from different providers. [You can browse and compare available models here.](https://openrouter.ai/models)