Back to Integrations
Laravel logoFramework

Laravel with DEVUP AI

Use DEVUP AI models from Laravel through the official Laravel AI SDK. Add DEVUP AI as an openai-compatible provider in config/ai.php and every agent can use it.

System Architecture

How Laravel Connects to DEVUP AI

1. Client
Laravel app
Laravel AI SDK agents
2. Gateway
DEVUP OpenAI-compatible API
POST /v1/chat/completions
3. Inference
Model
DeepSeek-V4-Pro
4. Response
Response
Text, stream events, tool calls and vectors

Configuration

Add the Provider

bash
composer require laravel/ai
php
'devupai' => [
    'driver' => 'openai-compatible',
    'url' => 'https://api.devupai.com/v1',
    'key' => env('DEVUP_API_KEY'),
    'models' => [
        'text' => ['default' => 'deepseek-ai/DeepSeek-V4-Pro'],
        'embeddings' => ['default' => 'BAAI/bge-m3'],
    ],
],
php
use function Laravel\Ai\agent;

$response = agent()->prompt('Reply with exactly: Salam DEVUP', provider: 'devupai');

echo $response->text, PHP_EOL;

Tools

Tool Calling in Laravel

php
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Ai\Contracts\Tool;
use Laravel\Ai\Tools\Request;

class GetOrderStatus implements Tool
{
    public function description(): string
    {
        return 'Look up the delivery status of an order by its ID.';
    }

    public function handle(Request $request): string
    {
        return 'Order ' . $request['order_id'] . ' has shipped. Tracking number: DZ-4471.';
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'order_id' => $schema->string()->required(),
        ];
    }
}

$answer = agent(tools: [new GetOrderStatus])->prompt('What is the status of order A-100?', provider: 'devupai');

echo $answer->text, PHP_EOL;

Capabilities

Supported Capabilities

Agents and streaming

agent()->prompt returns the reply; agent()->stream yields events you can also return from a route.

Tools

Implement the Tool contract with a JSON schema and a handle method, then pass the tool to the agent.

Structured output and embeddings

Pass a schema to agent() for typed results, or create vectors with Embeddings::for.

Local DZD billing

Metered billing in Algerian Dinar with BaridiMob, Edahabia, and CIB local payment support.

FAQ

Laravel and DEVUP AI

Does the Laravel AI SDK work with DEVUP AI?

Yes. Add a provider with the openai-compatible driver, url https://api.devupai.com/v1 and your DEVUP AI key, then pass provider: 'devupai' when you prompt.

Which Laravel and PHP versions are supported?

The Laravel AI SDK supports Laravel 12 and 13 and requires PHP 8.3 or newer.

How is Laravel usage billed on DEVUP AI?

Every request is a regular DEVUP AI API call, metered in Algerian Dinar on your account.

Ready to Build with Laravel on DEVUP AI?