Download the PHP package rodiumai/laravel-sdk without Composer

On this page you can find all versions of the php package rodiumai/laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sdk

rodiumai/laravel-sdk

Official PHP / Laravel SDK for the Rodium AI API — unified access to AI models (OpenAI, Anthropic, Google, DeepSeek…) with RODI credit billing and Mobile Money top-ups.

OpenAI-compatible REST API: same endpoints and payloads as documented at rodiumai.io/docs.

Latest Version on Packagist Total Downloads PHP Version Tests

Links

Resource URL
Packagist packagist.org/packages/rodiumai/laravel-sdk
Source code github.com/Docteur-Parfait/rodiumai-laravel-sdk
Laravel SDK guide rodiumai.io/docs/guides/laravel-sdk
API documentation rodiumai.io/docs
Dashboard & API keys rodiumai.io/dashboard

Table of contents

Requirements

Installation

Publish config (optional):

The ServiceProvider and RodiumAI Facade are auto-discovered.

Configuration

.env:

Variable Default Description
RODIUMAI_API_KEY — Secret key from the dashboard
RODIUMAI_BASE_URL https://api.rodiumai.io/v1 Gateway base URL (use http://localhost:8001/v1 locally)
RODIUMAI_DEFAULT_MODEL openai/gpt-4o Default model slug
RODIUMAI_TIMEOUT 30 HTTP timeout in seconds
RODIUMAI_LOCALE en Localized exception hints

Never commit .env or API keys.

Quick start

Laravel (Facade)

Plain PHP

Chat completions

POST /v1/chat/completions — OpenAI-compatible. All OpenAI fields pass-through (tools, response_format, …).

Parameters

Parameter Required Description
model yes Catalogue slug or smart alias (rodiumai/smart, rodium/fast, …)
messages yes String, ChatMessage objects, or arrays
max_tokens, temperature, top_p no Decoding
stream no SSE streaming
tools, tool_choice no Function calling
response_format no JSON mode / schema
session_id no Custom models memory

Multi-turn conversation

Multimodal vision

HTTP(S) image URLs work in chat (not in image/video generation).

Function calling

Smart routing

Alias Behavior
rodiumai/smart LLM router — metadata in $response->routing()
rodium/fast, rodium/pro, … Rule-based profiles

See Smart routing guide.


Streaming & real-time chat (SSE)

No WebSocket — real-time discussion uses SSE only.

Real-time chat loop

Laravel StreamedResponse


Models catalogue

Each model includes rodiumai_pricing, rodiumai_capabilities (modalities, streaming, tools, vision).


Embeddings

POST /v1/embeddings


Images (POST /v1/images/generations)

Parameter Required Notes
model, prompt yes
n no 1–10 (Imagen max 4)
size no 1024x1024, 1536x1024, …
quality no Affects RODI quote
aspect_ratio no Gemini
image, images no i2i — up to 14 refs
mask no OpenAI inpainting

Reference images: base64, data URL, or gs:// — no remote HTTP fetch.

Text-to-image

Image-to-image

Inpainting


Videos (POST /v1/videos/generations)

Always pass 'timeout' => 600 — jobs can take minutes.

Parameter Required Notes
model, prompt yes
duration_seconds no Default 8; Sora → 4/8/12 s
aspect_ratio, size no Sora layout
image no Start frame (image→video)
last_frame no End frame (Veo interpolation)

Text-to-video

Image-to-video

Interpolation (Veo)


Audio

Transcriptions — multipart

Parameter Required Notes
file yes File path
model yes
language no ISO-639-1 (fr, en)
prompt no Style hint
response_format no json, text, verbose_json

Speech — binary response

Parameter Required Notes
model, input yes
voice no alloy, echo, fable, onyx, nova, shimmer
response_format no mp3, opus, wav, pcm
speed no 0.25–4.0

Anthropic Messages

POST /v1/messages

Streaming: 'stream' => true — Anthropic SSE events.


Wallet & pricing

Error handling

See docs/api/errors.

HTTP Exception Notes
401 UnauthorizedException Invalid or missing API key
402 InsufficientCreditsException Top up RODI in dashboard
403 ForbiddenException Scope or model whitelist
404 NotFoundException Unknown model or resource
422 ValidationException Invalid request body
429 RateLimitException Use $e->retryAfter() for backoff
Other RodiumAIException $e->errorCode(), $e->responseBody()

SDK reference

Method Returns Gateway route
chat($messages, $options) ChatResponse POST /v1/chat/completions
stream($messages, $options) Generator<string> POST /v1/chat/completions (SSE)
models() ModelCollection GET /v1/models
modelInfo($id) ModelInfo GET /v1/models/{id}
codingModels() ModelCollection GET /v1/models/coding
embeddings($input, $options) EmbeddingResponse POST /v1/embeddings
images($options) ImageResponse POST /v1/images/generations
videos($options) VideoResponse POST /v1/videos/generations
transcribe($filePath, $options) TranscriptionResponse POST /v1/audio/transcriptions
speech($options) string (bytes) POST /v1/audio/speech
messages($options) MessageResponse POST /v1/messages
wallet() WalletResponse GET /v1/wallet
pricing($model?) PricingCollection GET /v1/pricing

Fluent builder: model(), temperature(), topP(), maxTokens(), systemPrompt(), language().

DTOs: ChatResponse, ChatMessage, ModelInfo, ModelCollection, EmbeddingResponse, ImageResponse, VideoResponse, TranscriptionResponse, MessageResponse, WalletResponse, PricingCollection.

Technical mapping: docs/api-alignment.md.

Local development

Point the SDK at a local gateway (e.g. Docker Compose on port 8001):

Migration 0.1.x → 0.2.0

Change Action
base_url restored Set RODIUMAI_BASE_URL if not using production
Static enums removed Use models() / ModelCollection for catalogue
ModelInfo::contextWindow Now reads rodiumai_capabilities.context_window (gateway shape)
New methods embeddings, images, videos, transcribe, speech, messages, wallet, pricing

Require ^0.2 in composer.json.

Testing

License

MIT — see LICENSE.


All versions of laravel-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rodiumai/laravel-sdk contains the following files

Loading the files please wait ...