Skip to main content

OpenRouter integration

Run any of 400+ AI models, generate images, speech, and video, manage keys, guardrails, and budgets per client, and react to every generation on your clients' OpenRouter accounts.

View the OpenRouter page

What it does

The OpenRouter integration lets you call any model OpenRouter routes to (OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, and hundreds more) from inside a workflow, billed against one OpenRouter account. Your workflows can summarize form submissions, classify tickets, draft copy, return structured JSON, or embed text for search.

It also helps you run OpenRouter as a service for clients. Give each client their own API key with a spending limit, report spend per model and per key, look up the exact cost of any generation, and start a workflow every time a request completes.

Connect an OpenRouter account

  1. Open your workspace in TaskJuice and navigate to Connections.
  2. Choose OpenRouter and click Connect.
  3. In a new tab, open the OpenRouter API keys page signed in to the account you want to connect.
  4. Click Create Key, name it after the workspace, optionally set a credit limit, and copy the sk-or-v1-... value into API Key.
  5. Optional: open Management API Keys, create a key with an expiry date, and paste it into Management Key.
  6. Save the connection.

The API key runs models. The management key cannot run models, but it is required for usage reporting, the API key, guardrail, workspace, BYOK, and Broadcast actions, and the Generation Completed trigger. Management keys can expire; create a new one and update the connection before the expiry date shown next to the key.

To rotate or revoke either key, delete it in OpenRouter, create a new one, and update the TaskJuice connection.

Triggers

  • Generation Completed (openrouter/generation-completed) starts one run for every request the OpenRouter account serves, with the model, provider, token usage, cost, timing, and any trace metadata you sent.

You do not register this yourself. Publishing a workflow adds a Webhook destination named "Automation" to the account's Broadcast settings using the management key. Turning the workflow off stops runs at once. Once no turned-on workflow on the connection uses an OpenRouter trigger, the destination is removed from the account about ten minutes later, and turning a workflow back on adds it again automatically.

Switch on Broadcast first. Under Settings > Observability in OpenRouter, turn on Enable Broadcast before you publish. While it is off, OpenRouter sends nothing and the trigger never fires. You can press Test Connection on the "Automation" destination: OpenRouter posts an empty trace for the test, which is accepted and starts no run.

Each run receives the request's trace in OpenTelemetry (OTLP JSON) format: a resourceSpans list with one entry per span. The span that matters is the generation span (span.type is generation); the others describe each provider attempt. Its attributes are { key, value } pairs. Read a value with an expression, for example the model:

resourceSpans.scopeSpans.spans[attributes[key="span.type" and value.stringValue="generation"]].attributes[key="gen_ai.request.model"].value.stringValue

Useful generation-span keys include gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.usage.total_cost, gen_ai.response.id (the generation ID), user.id, session.id, and trace.metadata.<your key>. To tag requests with your own values, such as a client ID or order number, send a trace object on the request; each key arrives as trace.metadata.<key>.

Actions

Actions marked as needing the management key use the optional Management Key on the connection. Everything else runs on the API key.

Generate text

  • Generate Response (openrouter/generate-response): Send one prompt, with instructions, to any model on OpenRouter and get the reply. The quickest way to summarize, classify, draft, or extract text in a workflow.
  • Create Chat Completion (openrouter/create-chat-completion): Send a full conversation (system, user, assistant, and tool messages) to any model on OpenRouter and get the reply, token usage, and cost.
  • Create Response (openrouter/create-response): Run a model through the OpenAI-compatible Responses API with optional tools, reasoning, and structured output.
  • Create Message (Anthropic Format) (openrouter/create-message): Run any OpenRouter model with an Anthropic Messages API request body and get an Anthropic-shaped reply.
  • Create Embeddings (openrouter/create-embeddings): Turn text into an embedding vector with any OpenRouter embedding model, for semantic search, deduplication, or clustering.
  • Rerank Documents (openrouter/rerank-documents): Score a list of documents by relevance to a query and return them ranked.
  • Ask System One Model (openrouter/ask-system-one): Send state and typed questions to a System One model such as Jev and get typed answers back.
  • Create Decision (Alpha) (openrouter/create-decision): Submit typed questions about a state to the Decisions router and get its answers. This is an alpha OpenRouter endpoint and may change.

Images, audio, and video

  • Generate Image (openrouter/generate-image): Generate images from a text prompt with an image model. Returns the images as data URLs or links.
  • Convert Text to Speech (openrouter/create-speech): Turn text into spoken audio with a speech model. Returns an audio file the next step can store or send.
  • Transcribe Audio (openrouter/create-transcription): Transcribe an audio file, or audio at a public URL, into text.
  • Generate Video (openrouter/create-video): Start a video generation job. The job runs asynchronously; read its status with Get Video Job and fetch the file with Download Video.
  • Get Video Job (openrouter/get-video-job): Get the status of a video generation job and, once finished, its output URLs.
  • Download Video (openrouter/download-video): Download the video file a finished generation job produced, as a file the next step can store or send.

Models and catalog

  • List Models (openrouter/list-models): List the models available on OpenRouter with pricing, context length, and supported parameters. Optionally search or filter by output type.
  • Get Model (openrouter/get-model): Get one model with its context length, pricing, modalities, and supported parameters.
  • List Model Endpoints (openrouter/list-model-endpoints): List every provider endpoint that serves a model, with its pricing, uptime, and limits.
  • Count Models (openrouter/count-models): Get how many models OpenRouter offers, optionally for one output modality.
  • List Models Available to Me (openrouter/list-user-models): List the models this key can actually use after its provider preferences, privacy settings, and guardrails apply.
  • List Embedding Models (openrouter/list-embedding-models): List the embedding models OpenRouter offers.
  • List Image Models (openrouter/list-image-models): List the image generation models OpenRouter offers.
  • List Image Model Endpoints (openrouter/list-image-model-endpoints): List the provider endpoints that serve an image model, with pricing and supported options.
  • List Video Models (openrouter/list-video-models): List the video generation models OpenRouter offers.
  • List Providers (openrouter/list-providers): List the inference providers OpenRouter routes to, with their policy links and data regions.
  • List Zero Data Retention Endpoints (openrouter/list-zdr-endpoints): List the model endpoints that remain available when zero data retention is enforced.
  • List Server Tools (openrouter/list-server-tools): List the server-side tools (web search, advisor, and more) a model can call through OpenRouter.
  • Get Server Tool (openrouter/get-server-tool): Get one server tool with its description and parameters.
  • List Benchmarks (openrouter/list-benchmarks): Get model benchmark scores from Artificial Analysis, Design Arena, and OpenRouter's own evals.
  • Get Task Market Share (openrouter/get-task-classifications): Get the share of OpenRouter traffic by task type (code generation, summarization, and more) over a trailing window.
  • List Top Apps (openrouter/list-app-rankings): List the top public apps on OpenRouter ranked by token usage for a date range.
  • List Daily Model Rankings (openrouter/list-daily-model-rankings): Get daily token totals for the top 50 public models, plus an aggregated row for everything else.
  • List Session Costs (openrouter/list-session-costs): Get the median cost per session by agent harness and model.

Generations and usage

  • Get Generation (openrouter/get-generation): Look up a finished generation by ID to get its final cost, token counts, latency, and the provider that served it. Useful for billing clients per request.
  • Get Generation Content (openrouter/get-generation-content): Get the stored prompt, completion, and error text for a generation. Only available when prompt logging is on for the account.
  • Submit Generation Feedback (openrouter/submit-generation-feedback): Report structured feedback on a generation, such as a wrong or low-quality answer. Needs the management key.
  • Get Current API Key Usage (openrouter/get-current-api-key): Get the spending limit, remaining budget, and daily, weekly, and monthly usage of the API key this connection uses.
  • Get Credits (openrouter/get-credits): Get the total credits purchased and used on the OpenRouter account. Needs the management key.
  • Get Activity (openrouter/get-activity): Get spend, requests, and token usage per model and day for the last 30 days, optionally for one API key. Use it to build client usage reports. Needs the management key.
  • Get Analytics Options (openrouter/get-analytics-options): List the metrics, dimensions, filter operators, and time granularities Query Analytics accepts. Needs the management key.
  • Query Analytics (openrouter/query-analytics): Query spend, tokens, and request counts for the account, grouped by model, key, user, or other dimensions. Needs the management key.

Batches

  • Create Batch (openrouter/create-batch): Submit many requests to run asynchronously against one endpoint. Poll Get Batch for progress and results.
  • List Batches (openrouter/list-batches): List the batches in the key's workspace, newest first.
  • Get Batch (openrouter/get-batch): Get a batch with its status and request counts. Finished batches include their results.
  • Delete Batch (openrouter/delete-batch): Delete a finished batch and its stored requests and results. Batches still running cannot be deleted.

Files and code sandboxes

  • Upload File (openrouter/upload-file): Upload a file (for example a PDF or image) so models can read it by ID.
  • List Files (openrouter/list-files): List the files stored in the key's workspace.
  • Get File (openrouter/get-file): Get a stored file's metadata: name, size, type, and creation time.
  • Download File (openrouter/download-file): Download a file OpenRouter generated (for example one saved out of a code sandbox) as a file the next step can store or send. Files you uploaded cannot be downloaded back.
  • Delete File (openrouter/delete-file): Delete a stored file.
  • List Container Files (openrouter/list-container-files): List the files a model's code-execution sandbox created. The container ID comes from a bash or shell tool result.
  • Get Container File (openrouter/get-container-file): Get the metadata of one file in a code-execution sandbox.
  • Download Container File (openrouter/download-container-file): Download a file from a code-execution sandbox as a file the next step can store or send.
  • Save Container File to Workspace (openrouter/save-container-file): Copy a file out of a code-execution sandbox into durable workspace storage so it outlives the sandbox.

Presets

  • List Presets (openrouter/list-presets): List the saved presets (named model, routing, and prompt configurations) on the account.
  • Get Preset (openrouter/get-preset): Get a preset with its current configuration.
  • List Preset Versions (openrouter/list-preset-versions): List every saved version of a preset.
  • Get Preset Version (openrouter/get-preset-version): Get one saved version of a preset.
  • Save Preset from Chat Completion (openrouter/save-preset-from-chat-completion): Save a chat completion request body as a preset, creating it or adding a new version. Call it later with model @preset/<slug>.
  • Save Preset from Message (openrouter/save-preset-from-message): Save an Anthropic Messages request body as a preset, creating it or adding a new version.
  • Save Preset from Response (openrouter/save-preset-from-response): Save a Responses API request body as a preset, creating it or adding a new version.

API keys

  • Create API Key (openrouter/create-api-key): Create a new OpenRouter API key, with an optional spending limit, reset period, and expiry. Give each client or project its own key so you can cap and report spend separately. Needs the management key.
  • List API Keys (openrouter/list-api-keys): List the API keys on the account with their limits and usage. Needs the management key.
  • Get API Key (openrouter/get-api-key): Get one API key's limit, remaining budget, and usage. Needs the management key.
  • Update API Key (openrouter/update-api-key): Rename, disable, re-enable, or change the spending limit of an API key. Needs the management key.
  • Delete API Key (openrouter/delete-api-key): Permanently delete an API key. Anything still using the key stops working immediately. Needs the management key.

Provider keys (BYOK)

  • List Provider Keys (BYOK) (openrouter/list-byok-credentials): List the provider API keys you brought to OpenRouter (BYOK). Needs the management key.
  • Add Provider Key (BYOK) (openrouter/create-byok-credential): Add your own provider API key (for example an OpenAI or Anthropic key) so OpenRouter routes through it. Needs the management key.
  • Get Provider Key (BYOK) (openrouter/get-byok-credential): Get one BYOK provider key's settings. The secret itself is never returned. Needs the management key.
  • Update Provider Key (BYOK) (openrouter/update-byok-credential): Change a BYOK provider key's name, secret, limits, or routing settings. Fields you leave empty stay unchanged. Needs the management key.
  • Delete Provider Key (BYOK) (openrouter/delete-byok-credential): Remove a BYOK provider key from OpenRouter. Needs the management key.

Guardrails

  • List Guardrails (openrouter/list-guardrails): List the guardrails (spend limits and model, provider, and privacy rules) on the account. Needs the management key.
  • Create Guardrail (openrouter/create-guardrail): Create a guardrail that caps spend and restricts which models, providers, and data regions keys and members can use. Needs the management key.
  • Get Guardrail (openrouter/get-guardrail): Get one guardrail with its limits and rules. Needs the management key.
  • Update Guardrail (openrouter/update-guardrail): Change a guardrail's limits or rules. Fields you leave empty stay unchanged. Needs the management key.
  • Delete Guardrail (openrouter/delete-guardrail): Delete a guardrail. Keys and members assigned to it lose its limits. Needs the management key.
  • List Guardrail Keys (openrouter/list-guardrail-keys): List the API keys assigned to a guardrail. Needs the management key.
  • Assign Keys to Guardrail (openrouter/assign-keys-to-guardrail): Put one or more API keys under a guardrail's limits. Needs the management key.
  • Remove Keys from Guardrail (openrouter/unassign-keys-from-guardrail): Take one or more API keys out from under a guardrail. Needs the management key.
  • List Guardrail Members (openrouter/list-guardrail-members): List the organization members assigned to a guardrail. Needs the management key.
  • Assign Members to Guardrail (openrouter/assign-members-to-guardrail): Put one or more organization members under a guardrail's limits. Needs the management key.
  • Remove Members from Guardrail (openrouter/unassign-members-from-guardrail): Take one or more organization members out from under a guardrail. Needs the management key.
  • List All Guardrail Key Assignments (openrouter/list-all-guardrail-key-assignments): List every API key assignment across all guardrails. Needs the management key.
  • List All Guardrail Member Assignments (openrouter/list-all-guardrail-member-assignments): List every member assignment across all guardrails. Needs the management key.

Workspaces and budgets

  • List Workspaces (openrouter/list-workspaces): List the workspaces on the account. Needs the management key.
  • Create Workspace (openrouter/create-workspace): Create a workspace, for example one per client, to keep its keys, spend, and settings separate. Needs the management key.
  • Get Workspace (openrouter/get-workspace): Get one workspace with its default models and logging settings. Needs the management key.
  • Update Workspace (openrouter/update-workspace): Change a workspace's name, default models, or logging settings. Fields you leave empty stay unchanged. Needs the management key.
  • Delete Workspace (openrouter/delete-workspace): Delete a workspace. Needs the management key.
  • List Workspace Members (openrouter/list-workspace-members): List the members of a workspace with their roles. Needs the management key.
  • Add Workspace Members (openrouter/add-workspace-members): Add organization members to a workspace. Needs the management key from an organization account.
  • Remove Workspace Members (openrouter/remove-workspace-members): Remove members from a workspace. Needs the management key from an organization account.
  • List Workspace Budgets (openrouter/list-workspace-budgets): List a workspace's spending budgets. Needs the management key.
  • Get Workspace Budget (openrouter/get-workspace-budget): Get a workspace's budget for one interval. Needs the management key.
  • Set Workspace Budget (openrouter/set-workspace-budget): Create or change a workspace's spending cap for an interval (for example a monthly cap per client). Needs the management key.
  • Delete Workspace Budget (openrouter/delete-workspace-budget): Remove a workspace's budget for an interval. Needs the management key.

Broadcast destinations

  • List Broadcast Destinations (openrouter/list-observability-destinations): List the Broadcast destinations (webhooks and observability tools) OpenRouter sends traces to. Needs the management key.
  • Create Broadcast Destination (openrouter/create-observability-destination): Send traces of every request to an observability tool such as Langfuse, Datadog, or a webhook. To start a workflow from each request, use the Generation Completed trigger instead. Needs the management key.
  • Get Broadcast Destination (openrouter/get-observability-destination): Get one Broadcast destination with its settings. Needs the management key.
  • Update Broadcast Destination (openrouter/update-observability-destination): Change a Broadcast destination's settings, sampling, or filters, or turn it on or off. Fields you leave empty stay unchanged. Needs the management key.
  • Delete Broadcast Destination (openrouter/delete-observability-destination): Delete a Broadcast destination so OpenRouter stops sending it traces. Needs the management key.

Organization and end users

  • List Organization Members (openrouter/list-organization-members): List the members of the OpenRouter organization with their roles. Needs the management key from an organization account.
  • Get Organization Settings (openrouter/get-organization-settings): Get the OpenRouter organization's settings. Needs the management key from an organization account.
  • Update Organization Settings (openrouter/update-organization-settings): Turn the filtered model catalog on or off for the OpenRouter organization. Needs the management key from an organization account.
  • List End Users (openrouter/list-end-users): List the end-user tracking IDs registered for the organization. Needs the management key from an organization account.
  • Register End User (openrouter/register-end-user): Register one of your own users' tracking IDs so its usage can be reported and limited. No login is created. Needs the management key from an organization account.
  • Get End User (openrouter/get-end-user): Get a registered end user by its tracking ID. Needs the management key from an organization account.
  • Update End User (openrouter/update-end-user): Reactivate or deactivate a registered end user. Needs the management key from an organization account.
  • Deactivate End User (openrouter/deactivate-end-user): Deactivate a registered end user. Its tracking ID is kept, and Update End User can reactivate it. Needs the management key from an organization account.

Known limitations

  • Model pickers list text models by default; the image and video pickers list those models. You can always type or map any model ID instead, including :free and :nitro variants.
  • Streaming is not exposed. Each call resolves once the full response is back.
  • Image, speech, transcription, and batch calls are paid. An account with no credit gets a 402 from OpenRouter, which the step reports as a failure without retrying.
  • Download File only works for files OpenRouter generated. OpenRouter refuses to send back files you uploaded.
  • Get Generation Content returns stored prompt and completion text only when prompt logging is on for the account.
  • Organization, end-user, and workspace member actions need an OpenRouter organization account. A personal account gets a 404 or 403.
  • OpenRouter allows at most five Webhook destinations per account, so at most five TaskJuice workspaces can use the Generation Completed trigger on one OpenRouter account at a time.
  • Generation Completed fires for every request on the account, including ones made outside TaskJuice. Filter on trace.metadata values or the model in the workflow if you only want some of them.
  • Per-key rate limits, credit caps, and provider routing rules are governed by the OpenRouter account. A 429 from OpenRouter is retried with backoff; a 402 means the account or key is out of credit.
Was this helpful?