ai-integrations-openrouter

Integrates OpenRouter chat completions into TypeScript apps via Replit AI Integrations proxy.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/AmirEmad11/instabot --skill ai-integrations-openrouter-amiremad11
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-integrations-openrouter
Source: https://github.com/AmirEmad11/instabot/tree/main/.local/skills/ai-integrations-openrouter
Command: npx skills add https://github.com/AmirEmad11/instabot --skill ai-integrations-openrouter-amiremad11

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, p-limit, p-retry, and includes references (resource) components.

What problem does it solve? Setting up access to long-tail LLM providers like Llama, Mistral, Qwen, DeepSeek, and Grok normally requires managing your own OpenRouter API key and wiring up clients, database schemas, and streaming endpoints by hand. This Skill automates that entire setup through the Replit AI Integrations proxy, which provisions credentials automatically and bills usage to your Replit credits. ## Core Features & Use Cases - Keyless OpenRouter Access: Provisions AI_INTEGRATIONS_OPENROUTER_BASE_URL and AI_INTEGRATIONS_OPENROUTER_API_KEY automatically, with a pre-configured OpenAI SDK client pointed at OpenRouter. - Full Chat Stack Templates: Copies a workspace integration package, Drizzle schemas for conversations and messages tables, and OpenAPI spec entries for chat endpoints including SSE streaming responses. - Batch Processing Utilities: Provides batchProcess and batchProcessWithSSE helpers with rate limiting, exponential backoff retries, and SSE progress events for multi-item LLM workloads. - Use Case: Build a chat application backed by meta-llama/llama-3.3-70b-instruct with persistent conversation history, streaming responses, and batch categorization jobs, all without signing up for an OpenRouter account. ## Quick Start Ask the agent to set up the OpenRouter AI integration and build a streaming chat endpoint using a Llama model with conversation persistence.

Frequently Asked Questions about ai-integrations-openrouter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use OpenRouter models without my own API key?

Call setupReplitAIIntegrations with providerSlug "openrouter" in the JavaScript sandbox. It automatically provisions AI_INTEGRATIONS_OPENROUTER_BASE_URL and AI_INTEGRATIONS_OPENROUTER_API_KEY, and usage is billed to your Replit credits.

How do I find available OpenRouter model names?

Query the OpenRouter models endpoint with curl https://openrouter.ai/api/v1/models and grep for the desired model id. Never guess model names; if the model is not listed, inform the user it is unavailable on OpenRouter.

Does OpenRouter through AI Integrations support image generation or embeddings?

No. The integration only supports the chat completions API. Image generation, audio, embeddings, fine-tuning, and the files API are unsupported and require using OpenRouter directly with your own API key.

How do I stream OpenRouter chat responses with SSE?

Call openrouter.chat.completions.create with stream: true, set text/event-stream headers, and write each chunk as data events followed by a final done event. Consume the stream on the client with fetch and ReadableStream, not a generated React Query hook.

How do I handle rate limits when making many OpenRouter calls?

Use the batchProcess utility from the integration package, which wraps p-limit and p-retry with configurable concurrency and exponential backoff. It detects rate limit errors via isRateLimitError and retries only those, aborting immediately on other failures.

Why does the OpenRouter client throw an error at startup?

The client throws if AI_INTEGRATIONS_OPENROUTER_BASE_URL or AI_INTEGRATIONS_OPENROUTER_API_KEY are missing. Retry the setupReplitAIIntegrations call; if it still fails after three attempts, switch to an API-key-based approach.