Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Openrouter

Laravel Openrouter Laravel Package

moe-mizrak/laravel-openrouter

A Laravel package for integrating OpenRouter's API, giving your app a clean, fluent way to access hundreds of AI models for chat completions, streaming, and more. Includes configurable providers, request handling, and Laravel-friendly tooling.

View on GitHub
Deep Wiki
Context7

Laravel package for OpenRouter (A unified interface for LLMs)

Frequently asked questions about Laravel Openrouter
How do I install laravel-openrouter?
Install it with composer require moe-mizrak/laravel-openrouter, publish the package configuration, and set OPENROUTER_API_KEY in your environment or secret store. The package follows Laravel conventions with a service provider, facade, and publishable config, so you can resolve it through the container. Run a smoke test against a low-cost model before wiring it into application code.
What Laravel and PHP versions does this package support?
The supplied context does not list exact Laravel or PHP version constraints, so check the package composer.json and Packagist metadata before adopting it. Test against the Laravel and PHP versions your application actually runs. Pin the package version you validate so a future constraint change cannot surprise production.
Does laravel-openrouter support streaming responses?
Yes, the package's stated scope includes chat completions and streaming through OpenRouter. Confirm the exact streaming API in the README or source before building browser token delivery, because streaming implementations vary. Add an integration smoke test that exercises the stream path with a cheap model.
Does it support tool calling, structured JSON output, or multimodal inputs?
The overview does not explicitly confirm tool or function calling, structured JSON output, or multimodal inputs. Because the package is a thin wrapper over OpenRouter's OpenAI-compatible API, those features may be reachable through raw request options, but verify in source before committing. Treat each capability as an acceptance criterion in a short spike.
How do I configure OpenRouter providers and model routing?
The package includes publishable configuration and mentions configurable providers, so model and provider selection is intended to be managed through config. For advanced OpenRouter routing such as provider order, fallbacks, allow_fallbacks, or price and latency preferences, confirm whether the package exposes them or whether you must bypass to raw request options. Document the chosen routing behavior and test failover explicitly.
How are API errors, rate limits, and content-policy refusals handled?
The provided context does not say whether errors surface as typed exceptions, result objects, or silent nulls. Confirm the behavior in the source, then map OpenRouter provider errors, rate limits, and content-policy refusals into your own catchable exception types. Set explicit timeouts and retry rules per call rather than relying on defaults.
Can I test laravel-openrouter without making real OpenRouter API calls?
The context does not confirm a built-in HTTP fake or contract-test harness. If the package uses Laravel's HTTP client, you can fake that layer in tests; otherwise inject a fake transport or keep calls behind your own adapter interface. Keep a small live smoke test separate from the fast test suite.
Is this package mature enough for production use?
The package is MIT-licensed and idiomatic Laravel packaging, but the assessment flags a small user base of roughly 159 stars and likely single-maintainer risk. It can be reasonable for bounded internal use with version pinning, tests, and a fallback path. Avoid putting it on a critical path without a mitigation plan or an exit strategy.
Does it return token usage and cost per request?
The overview does not state whether token usage and cost per request are returned by the package. OpenRouter may provide usage metadata depending on request options, but you should verify the response shape and plan to capture accounting in your own layer. A single API key fronts all providers, so add cost monitoring and circuit breakers.
What are the alternatives to using this Laravel OpenRouter package?
Alternatives include OpenRouter's raw HTTP API, OpenAI-compatible SDKs, or first-party vendor SDKs when you only need one model provider. This package is best treated as a convenience transport adapter for Laravel, with your own LlmClient interface, prompt management, and response normalization above it. Choose it when the fluent Laravel integration and OpenRouter aggregation outweigh the maturity risk.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console