How to connect Openrouter to Mastra AI in 2 mins: No API key needed

You can send prompts to models from OpenAI, Anthropic, Google, DeepSeek and others from Mastra AI, and use image, video, speech and embedding models with your own OpenRouter key. Composio lets you use OpenRouter inside Mastra AI.

OpenrouterInstant · No API key

Mastra AI runs Openrouter through Composio, and the cost comes out of your free $2.

  • A reply from a top model$0.020
  • A reply from a low-cost model$0.002
  • A long reply from a premium model$0.040

$2 ≈ 100 replies or 1000 replies

Composio Instant

What you can do with your free $2

What your free $2 gets you with Openrouter
When you ask Mastra AI forMastra AI uses this toolCostWhat $2 gets you
A reply from a top modelCreate Chat Completion$0.020 per replyAbout 100 replies
A reply from a low-cost modelCreate Chat Completion$0.002 per replyAbout 1,000 replies
A long reply from a premium modelCreate Chat Completion$0.040 per replyAbout 50 replies

You pay Openrouter's price for each call with 0% markup, plus the regular Composio tool call charge. There's no Openrouter subscription, and you only pay for what you use.

1 of 122 Openrouter tools work without a key. For Activate a validated private endpoint, Bulk add members to a workspace, Bulk assign keys to a guardrail, Bulk assign members to a guardrail, Bulk remove members from a workspace, Bulk unassign keys from a guardrail and 115 more, connect your own Openrouter key. Read how Instant works.

How it works

How to connect Openrouter to Mastra AI

Composio adds Openrouter to Mastra AI as an Instant toolkit. You connect Composio to Mastra AI once, and then Mastra AI can use Openrouter right away. There are two ways to do this:

  • Bring your own key

    You bring your own Openrouter API key, set it up, and use it.

  • Use the Composio wallet

    Instant

    Composio runs each call on its own Openrouter account, so you don't have to set anything up at Openrouter, and your first $2 is free.

You do the setup one time and it takes about a minute. If you build Openrouter into your own product, turn on Instant toolkits in your project settings so your agent can call Openrouter for each of your users without a Openrouter API key, and read Instant tools in the Composio docs for the setup steps and code examples.

Get started

Start to use Openrouter in Mastra AI in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Mastra AI

    Follow the setup below. You only do this once.

  3. Ask Mastra AI for something

    Try a Openrouter prompt. The cost comes out of your $2.

Setup

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Node.js 18 or higher
  • A Composio account with an active API key
  • An OpenAI API key
  • Basic familiarity with TypeScript
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key.
  • You need credits or a connected billing setup to use the models.
  • Store the key somewhere safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Go to Settings and copy your API key.
  • This key lets your Mastra agent talk to Composio and reach Openrouter through MCP.
3

Install dependencies

bash
npm install @composio/core @mastra/core @mastra/mcp @ai-sdk/openai dotenv

Install the required packages.

What's happening:

  • @composio/core is the Composio SDK for creating MCP sessions
  • @mastra/core provides the Agent class
  • @mastra/mcp is Mastra's MCP client
  • @ai-sdk/openai is the model wrapper for OpenAI
  • dotenv loads environment variables from .env
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates your requests to Composio
  • COMPOSIO_USER_ID tells Composio which user this session belongs to
  • OPENAI_API_KEY lets the Mastra agent call OpenAI models
5

Import libraries and validate environment

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey as string,
});
What's happening:
  • dotenv/config auto loads your .env so process.env.* is available
  • openai gives you a Mastra compatible model wrapper
  • Agent is the Mastra agent that will call tools and produce answers
  • MCPClient connects Mastra to your Composio MCP server
  • Composio is used to create a Tool Router session
6

Create a Tool Router session for Openrouter

typescript
async function main() {
  const session = await composio.create(
    composioUserID as string,
    {
      toolkits: ["openrouter"],
    },
  );

  const composioMCPUrl = session.mcp.url;
  console.log("Openrouter MCP URL:", composioMCPUrl);
What's happening:
  • create spins up a short-lived MCP HTTP endpoint for this user
  • The toolkits array contains "openrouter" for Openrouter access
  • session.mcp.url is the MCP URL that Mastra's MCPClient will connect to
7

Configure Mastra MCP client and fetch tools

typescript
const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      nasdaq: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

console.log("Fetching MCP tools from Composio...");
const composioTools = await mcpClient.getTools();
console.log("Number of tools:", Object.keys(composioTools).length);
What's happening:
  • MCPClient takes an id for this client and a list of MCP servers
  • The headers property includes the x-api-key for authentication
  • getTools fetches the tool definitions exposed by the Openrouter toolkit
8

Create the Mastra agent

typescript
const agent = new Agent({
    name: "openrouter-mastra-agent",
    instructions: "You are an AI agent with Openrouter tools via Composio.",
    model: "openai/gpt-5",
  });
What's happening:
  • Agent is the core Mastra agent
  • name is just an identifier for logging and debugging
  • instructions guide the agent to use tools instead of only answering in natural language
  • model uses openai("gpt-5") to configure the underlying LLM
9

Set up interactive chat interface

typescript
let messages: AiMessageType[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end.\n");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();

rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

  if (!trimmedInput) {
    rl.prompt();
    return;
  }

  messages.push({
    id: crypto.randomUUID(),
    role: "user",
    content: trimmedInput,
  });

  console.log("\nAgent is thinking...\n");

  try {
    const response = await agent.generate(messages, {
      toolsets: {
        openrouter: composioTools,
      },
      maxSteps: 8,
    });

    const { text } = response;

    if (text && text.trim().length > 0) {
      console.log(`Agent: ${text}\n`);
        messages.push({
          id: crypto.randomUUID(),
          role: "assistant",
          content: text,
        });
      }
    } catch (error) {
      console.error("\nError:", error);
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    console.log("\nSession ended.");
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});
What's happening:
  • messages keeps the full conversation history in Mastra's expected format
  • agent.generate runs the agent with conversation history and Openrouter toolsets
  • maxSteps limits how many tool calls the agent can take in a single run
  • onStepFinish is a hook that prints intermediate steps for debugging

Complete Code

Here's the complete code to get you started with Openrouter and Mastra AI:

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({ apiKey: composioAPIKey as string });

async function main() {
  const session = await composio.create(composioUserID as string, {
    toolkits: ["openrouter"],
  });

  const composioMCPUrl = session.mcp.url;

  const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      openrouter: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

  const composioTools = await mcpClient.getTools();

  const agent = new Agent({
    name: "openrouter-mastra-agent",
    instructions: "You are an AI agent with Openrouter tools via Composio.",
    model: "openai/gpt-5",
  });

  let messages: AiMessageType[] = [];

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (input: string) => {
    const trimmed = input.trim();
    if (["exit", "quit"].includes(trimmed.toLowerCase())) {
      rl.close();
      return;
    }

    messages.push({ id: crypto.randomUUID(), role: "user", content: trimmed });

    const { text } = await agent.generate(messages, {
      toolsets: { openrouter: composioTools },
      maxSteps: 8,
    });

    if (text) {
      console.log(`Agent: ${text}\n`);
      messages.push({ id: crypto.randomUUID(), role: "assistant", content: text });
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main();
Try it

Ask Mastra AI for something with Openrouter

Start a new chat and try this prompt:

Send this function to [model, e.g. a GPT or Gemini model] on OpenRouter for a code review and give me the issues it finds, ranked by how serious they are: [paste code].

Mastra AI runs it on Instant and shows you the result. It doesn't ask you for a Openrouter key, and the cost comes out of your $2. You can see each call in your wallet.

Optional: connect your own Openrouter key

If you want Activate a validated private endpoint, Bulk add members to a workspace, Bulk assign keys to a guardrail, Bulk assign members to a guardrail, Bulk remove members from a workspace, Bulk unassign keys from a guardrail and 115 more, you need your own key. Ask Mastra AI to connect your Openrouter account, and it gives you a Composio link:

Connect my Openrouter account using Composio.

Open the link, paste your Openrouter API key and click Connect Account. You can get a key from OpenRouter API keys page. After that, Composio uses your key first and doesn't charge Instant for those calls.

Starter prompts

Use your first $2: copy a prompt into Mastra AI

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Get a second opinion on your code from another model

    About $0.02

    Sends your code to a different model for review and lists the issues it finds that you might have missed.

    Send this function to [model, e.g. a GPT or Gemini model] on OpenRouter for a code review and give me the issues it finds, ranked by how serious they are: [paste code].

  • Compare answers from 3 models side by side

    About $0.06

    Asks 3 different models the same question and lines up their answers so you can pick the best one.

    Ask [model 1], [model 2] and [model 3] on OpenRouter the same question and show their answers side by side, with a note on where they disagree: [your question].

  • Test your app's prompt on a low-cost model

    Less than $0.01

    Runs your app's prompt on a few sample inputs with a cheap model so you can see if it holds up before you build on it.

    Run my system prompt on [low-cost model, e.g. a DeepSeek or Qwen model] with these 5 test inputs. Show me each output, flag any that break my rules and tell me how many tokens each call used: [paste system prompt and test inputs].

  • Sort a batch of feedback with a cheap model

    Less than $0.01

    Hands a long list of customer comments to a low-cost model that tags each one as a bug, request or praise.

    Use a low-cost model on OpenRouter to tag each of these customer comments as bug, feature request, praise or other, and give me a count per tag: [paste up to 50 comments].

What it can do

What Mastra AI can do with Openrouter

Works without a key

  • A reply from a top model
  • A reply from a low-cost model
  • A long reply from a premium model

Needs your own Openrouter key

  • Activate a validated private endpoint
  • Bulk add members to a workspace
  • Bulk assign keys to a guardrail
  • Bulk assign members to a guardrail
  • Bulk remove members from a workspace
  • Bulk unassign keys from a guardrail
  • Bulk unassign members from a guardrail
  • Create a new API key
  • and 113 more
Tools and prices

Supported tools (122)

Openrouter tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Create Chat CompletionGenerate a chat-style completion from messages and a selected model, with function-call request options.YesBilled at the selected model's OpenRouter token rate, from $0.02 per 1M input tokens and $0.04 per 1M output tokens
Activate a validated private endpointMake a validated draft routable.Needs your own keyBilled to your own Openrouter key
Bulk add members to a workspaceAdd multiple organization members to a workspace.Needs your own keyBilled to your own Openrouter key
Bulk assign keys to a guardrailAssign multiple API keys to a specific guardrail.Needs your own keyBilled to your own Openrouter key
Bulk assign members to a guardrailAssign multiple organization members to a specific guardrail.Needs your own keyBilled to your own Openrouter key
Bulk remove members from a workspaceRemove multiple members from a workspace.Needs your own keyBilled to your own Openrouter key
Bulk unassign keys from a guardrailUnassign multiple API keys from a specific guardrail.Needs your own keyBilled to your own Openrouter key
Bulk unassign members from a guardrailUnassign multiple organization members from a specific guardrail.Needs your own keyBilled to your own Openrouter key
Create a new API keyCreate a new API key for the authenticated user.Needs your own keyBilled to your own Openrouter key
Create authorization codeCreate an authorization code for the PKCE flow to generate a user-controlled API keyNeeds your own keyBilled to your own Openrouter key
Create a batchCreates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`).Needs your own keyBilled to your own Openrouter key
Create a BYOK provider credentialCreate a new bring-your-own-key (BYOK) provider credential.Needs your own keyBilled to your own Openrouter key
Create Coinbase ChargeTool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account.Needs your own keyBilled to your own Openrouter key
Create EmbeddingsCreate vector embeddings for text, token, or multimodal inputs.Needs your own keyBilled to your own Openrouter key
Create a guardrailCreate a new guardrail for the authenticated user.Needs your own keyBilled to your own Openrouter key
Create Message (Anthropic Format)Create a message using Anthropic Messages API format via OpenRouter, with text, image, PDF, tool, and extended-thinking request options.Needs your own keyBilled to your own Openrouter key
Create an observability destinationCreate a new observability destination.Needs your own keyBilled to your own Openrouter key
Create a preset from a chat-completions request bodyCreates a preset (or a new version of an existing one) from an inference request body.Needs your own keyBilled to your own Openrouter key
Create a preset from a messages request bodyCreates a preset (or a new version of an existing one) from an inference request body.Needs your own keyBilled to your own Openrouter key
Create a preset from a responses request bodyCreates a preset (or a new version of an existing one) from an inference request body.Needs your own keyBilled to your own Openrouter key
Show all 122 tools
More Openrouter tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Create a private endpointCreate a private endpoint as a draft.Needs your own keyBilled to your own Openrouter key
Create a SCIM group mappingCreate a SCIM group-to-workspace role mapping.Needs your own keyBilled to your own Openrouter key
Start a SCIM directory syncStart a SCIM directory sync.Needs your own keyBilled to your own Openrouter key
Create SpeechSynthesize speech from text or multi-speaker turns.Needs your own keyBilled to your own Openrouter key
Create TranscriptionTranscribe audio into text using an OpenRouter speech-to-text model.Needs your own keyBilled to your own Openrouter key
Create Video GenerationSubmit an asynchronous video generation job to OpenRouter.Needs your own keyBilled to your own Openrouter key
Create a workspaceCreate a new workspace for the authenticated user.Needs your own keyBilled to your own Openrouter key
Delete an API keyDelete one of the authenticated account's own API keys, revoking the selected key's access.Needs your own keyBilled to your own Openrouter key
Delete a batchDeletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results.Needs your own keyBilled to your own Openrouter key
Delete a BYOK provider credentialDelete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`.Needs your own keyBilled to your own Openrouter key
Delete a fileDeletes a file owned by the requesting workspace.Needs your own keyBilled to your own Openrouter key
Delete a guardrailDelete an existing guardrail.Needs your own keyBilled to your own Openrouter key
Delete an observability destinationDelete an existing observability destination.Needs your own keyBilled to your own Openrouter key
Delete a private endpointDelete a private endpoint and stop routing to it.Needs your own keyBilled to your own Openrouter key
Delete a SCIM group mappingDelete a SCIM group-to-workspace mapping.Needs your own keyBilled to your own Openrouter key
Delete a workspaceDelete an existing workspace.Needs your own keyBilled to your own Openrouter key
Delete a workspace budgetRemove the budget for a given interval.Needs your own keyBilled to your own Openrouter key
Disable a private endpointStop routing to an active endpoint without deleting it.Needs your own keyBilled to your own Openrouter key
Download Container File ContentDownload raw file content from an OpenRouter container using its canonical container and file IDs.Needs your own keyBilled to your own Openrouter key
Download File ContentDownload raw content of a server-created file.Needs your own keyBilled to your own Openrouter key
Enable a private endpointResume routing to a disabled endpoint.Needs your own keyBilled to your own Openrouter key
Exchange authorization code for API keyExchange an authorization code from the PKCE flow for a user-controlled API keyNeeds your own keyBilled to your own Openrouter key
Exchange a workload identity tokenRFC 8693 token exchange.Needs your own keyBilled to your own Openrouter key
Generate an imageGenerates an image from a text prompt via the image generation routerNeeds your own keyBilled to your own Openrouter key
Get available analytics metrics and dimensionsReturns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint.Needs your own keyBilled to your own Openrouter key
Get a single API keyGet a single API key by hash.Needs your own keyBilled to your own Openrouter key
Top apps by token usageReturns the top public apps on OpenRouter ranked by token usage inside the requested date window, matching the public apps marketplace on openrouter.ai/apps.Needs your own keyBilled to your own Openrouter key
Get a batchReturns a batch with its status and request counts.Needs your own keyBilled to your own Openrouter key
List BenchmarksUnified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals).Needs your own keyBilled to your own Openrouter key
Get a BYOK provider credentialGet a single bring-your-own-key (BYOK) provider credential by its `id`.Needs your own keyBilled to your own Openrouter key
Retrieve a container fileReturns the metadata of a single file in a container.Needs your own keyBilled to your own Openrouter key
Get CreditsTool to get the current API credit balance for the authenticated user.Needs your own keyBilled to your own Openrouter key
Get Current KeyTool to get information about the currently authenticated API key.Needs your own keyBilled to your own Openrouter key
Get file metadataRetrieves metadata for a single file owned by the requesting workspace.Needs your own keyBilled to your own Openrouter key
Get GenerationTool to retrieve a generation result by its unique ID.Needs your own keyBilled to your own Openrouter key
Get a guardrailGet a single guardrail by ID.Needs your own keyBilled to your own Openrouter key
Get a model by its slugReturns full details for a single model identified by its author and slug (e.g.Needs your own keyBilled to your own Openrouter key
Get Models CountTool to get the total count of available models on OpenRouter.Needs your own keyBilled to your own Openrouter key
OpenRouter access token signing keysRFC 7517 JWK Set containing the public keys OpenRouter signs access tokens with.Needs your own keyBilled to your own Openrouter key
Get an observability destinationFetch a single observability destination by its UUID.Needs your own keyBilled to your own Openrouter key
Get organization settingsGet the settings of the organization associated with the authenticated management key.Needs your own keyBilled to your own Openrouter key
Get a presetRetrieves a preset by its slug with its currently designated version inline.Needs your own keyBilled to your own Openrouter key
Get a specific version of a presetRetrieves a specific version of a preset by its slug and version number.Needs your own keyBilled to your own Openrouter key
Get a private endpointGet one private endpoint with its upstream configuration and current pricing.Needs your own keyBilled to your own Openrouter key
Daily token totals for top 50 modelsReturns the top 50 public models per day by total token usage on OpenRouter, plus a single aggregated `other` row per day that sums every model outside that top 50.Needs your own keyBilled to your own Openrouter key
Get a SCIM group mappingGet a SCIM group-to-workspace mapping.Needs your own keyBilled to your own Openrouter key
Get SCIM directory sync statusGet SCIM directory sync status.Needs your own keyBilled to your own Openrouter key
Cost per session by harness and modelReturns weekly refreshed, aggregated cost-per-session cells for the published harnesses.Needs your own keyBilled to your own Openrouter key
Task classification market shareReturns the market-share breakdown of OpenRouter traffic by task classification (e.g.Needs your own keyBilled to your own Openrouter key
Get a server toolOne server tool by canonical name or any accepted alias, with the models that run it natively.Needs your own keyBilled to your own Openrouter key
Get user activity grouped by endpointReturns user activity data grouped by endpoint for the last 30 (completed) UTC days.Needs your own keyBilled to your own Openrouter key
Get Video ContentDownload one output from a completed OpenRouter video generation job.Needs your own keyBilled to your own Openrouter key
Get Video GenerationPoll a video generation job for its status, outputs, and usage.Needs your own keyBilled to your own Openrouter key
Get a workspaceGet a single workspace by ID or slug.Needs your own keyBilled to your own Openrouter key
Get a workspace budgetRetrieve the budget for a given interval.Needs your own keyBilled to your own Openrouter key
List API keysList all API keys for the authenticated user.Needs your own keyBilled to your own Openrouter key
List Available ModelsList available OpenRouter models, optionally filtered by category.Needs your own keyBilled to your own Openrouter key
List batchesLists batches in the workspace of the authenticating API key, newest first.Needs your own keyBilled to your own Openrouter key
List BYOK provider credentialsList the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace.Needs your own keyBilled to your own Openrouter key
List container filesLists the files in a container, in lexicographic path order.Needs your own keyBilled to your own Openrouter key
List Embedding ModelsList available OpenRouter embedding models with properties including architecture, pricing, and capabilities.Needs your own keyBilled to your own Openrouter key
List filesLists files belonging to the workspace of the authenticating API key.Needs your own keyBilled to your own Openrouter key
Get stored prompt, completion, and error content for a generationGet stored prompt, completion, and error content for a generationNeeds your own keyBilled to your own Openrouter key
List key assignments for a guardrailList all API key assignments for a specific guardrail.Needs your own keyBilled to your own Openrouter key
List member assignments for a guardrailList all organization member assignments for a specific guardrail.Needs your own keyBilled to your own Openrouter key
List guardrailsList all guardrails for the authenticated user.Needs your own keyBilled to your own Openrouter key
List endpoints for an image modelReturns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.Needs your own keyBilled to your own Openrouter key
List image generation modelsLists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.Needs your own keyBilled to your own Openrouter key
List all key assignmentsList all API key guardrail assignments for the authenticated user.Needs your own keyBilled to your own Openrouter key
List all member assignmentsList all organization member guardrail assignments for the authenticated user.Needs your own keyBilled to your own Openrouter key
OpenRouter List Model EndpointsTool to list endpoints for a specific model.Needs your own keyBilled to your own Openrouter key
List observability destinationsList the observability destinations configured for the authenticated entity's default workspace.Needs your own keyBilled to your own Openrouter key
List organization membersList all members of the organization associated with the authenticated management key.Needs your own keyBilled to your own Openrouter key
List presetsLists all presets for the authenticated user, ordered by most recently updated first.Needs your own keyBilled to your own Openrouter key
List versions of a presetLists all versions of a preset, ordered by version number ascending (oldest first).Needs your own keyBilled to your own Openrouter key
List private endpointsList the organization's private endpoints, including drafts.Needs your own keyBilled to your own Openrouter key
OpenRouter List ProvidersTool to list all AI model providers available through the OpenRouter API.Needs your own keyBilled to your own Openrouter key
List SCIM group mappingsList SCIM group-to-workspace mappings for the organization.Needs your own keyBilled to your own Openrouter key
List SCIM groupsList SCIM groups for the organization.Needs your own keyBilled to your own Openrouter key
List server toolsLists every server tool OpenRouter can run on behalf of a model: accepted `tools[].type` spellings per API format, the engines behind it with their pricing, and how many endpoints run it natively.Needs your own keyBilled to your own Openrouter key
List User ModelsList models filtered by user provider preferences, privacy settings, and guardrails.Needs your own keyBilled to your own Openrouter key
List Video ModelsList video generation models and their supported capabilities.Needs your own keyBilled to your own Openrouter key
List workspace budgetsList all budgets configured for a workspace.Needs your own keyBilled to your own Openrouter key
List workspace membersList all members of a workspace.Needs your own keyBilled to your own Openrouter key
List workspacesList all workspaces for the authenticated user.Needs your own keyBilled to your own Openrouter key
OpenRouter List ZDR EndpointsTool to preview the impact of Zero Data Retention (ZDR) on the available endpoints.Needs your own keyBilled to your own Openrouter key
Promote a container file into workspace documentsCopies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container.Needs your own keyBilled to your own Openrouter key
Query analytics dataExecute an analytics query with specified metrics, dimensions, filters, and time range.Needs your own keyBilled to your own Openrouter key
Rerank ContentRank text or multimodal documents by relevance to a query.Needs your own keyBilled to your own Openrouter key
Submit feedback for a generationSubmit structured feedback on a generation the authenticated user made.Needs your own keyBilled to your own Openrouter key
Submit a System One requestSends state and typed questions to a System One model such as Jev and returns its answers.Needs your own keyBilled to your own Openrouter key
Update an API keyUpdate one of the authenticated account's own API keys.Needs your own keyBilled to your own Openrouter key
Update a BYOK provider credentialUpdate an existing bring-your-own-key (BYOK) provider credential by its `id`.Needs your own keyBilled to your own Openrouter key
Update a guardrailUpdate an existing guardrail, or materialize an unconfigured workspace default guardrail.Needs your own keyBilled to your own Openrouter key
Update an observability destinationUpdate an existing observability destination.Needs your own keyBilled to your own Openrouter key
Update organization settingsUpdate the settings of the organization associated with the authenticated management key.Needs your own keyBilled to your own Openrouter key
Update a private endpointChange any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint.Needs your own keyBilled to your own Openrouter key
Update a SCIM group mappingUpdate a SCIM group mapping role.Needs your own keyBilled to your own Openrouter key
Update a workspaceUpdate an existing workspace by ID or slug.Needs your own keyBilled to your own Openrouter key
Upload FileUpload a file for future API calls under the authenticating key's workspace.Needs your own keyBilled to your own Openrouter key
Create or update a workspace budgetCreate or update the budget for a given interval.Needs your own keyBilled to your own Openrouter key
Validate a draft private endpointSend a live test request to the draft endpoint using the given workspace's BYOK credential for its provider.Needs your own keyBilled to your own Openrouter key
Pricing

How you pay for Openrouter

  • Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
  • You pay for each callYou pay Openrouter's price with 0% markup, plus the regular Composio tool call charge.
  • Your own key comes firstIf you connect your own Openrouter key, Composio uses it and doesn't charge Instant for those calls.
  • You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
  • You can see each callYour wallet shows each call and what it cost.
  • When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
Help

Troubleshooting

  1. 1. Mastra AI asks me for a Openrouter API key

    You may have asked for something that needs your own key, like Activate a validated private endpoint, Bulk add members to a workspace, Bulk assign keys to a guardrail, Bulk assign members to a guardrail, Bulk remove members from a workspace, Bulk unassign keys from a guardrail and 115 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.

  2. 2. I can't see my free $2

    Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.

  3. 3. A Openrouter call failed with a balance error

    Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Openrouter key, then try again.

FAQ

Frequently asked questions

Start with Openrouter.It takes 30 seconds.

New accounts get a one-time $2 starter credit for Instant calls.Run Openrouter from your agent with no Openrouter key.

Get $2 starter credit