Skip to content
Start freeGPT-5 · Claude · DeepSeek V4 · Qwen3 — in ₹One OpenAI-compatible endpointBilled in rupeesGST invoiceNo international cardGet started →Start freeGPT-5 · Claude · DeepSeek V4 · Qwen3 — in ₹One OpenAI-compatible endpointBilled in rupeesGST invoiceNo international cardGet started →
Integrations

PHP AI API client (India)

Call GPT, Claude, DeepSeek and Qwen from PHP with a plain HTTP request, one rupee-billed key, one Indian GST invoice.

PHP applications can call unoblox with nothing more than the functions already built into the language, such as curl or file_get_contents, since the endpoint follows the same OpenAI-compatible request and response shape used everywhere else. One key and one base URL cover GPT, Claude, DeepSeek, Qwen, and every other model in the catalog, billed per token in rupees on one monthly GST invoice.

Why a PHP project does not need a dedicated SDK

Most PHP backends already have an HTTP layer, whether that is raw curl, Guzzle, or a framework's own HTTP client. Because unoblox speaks the standard chat-completions format, wiring in a new model is a matter of pointing that existing HTTP layer at a new base URL and key rather than installing and learning a new package.

A minimal request

Using only PHP's built-in stream functions, a complete call looks like this:

<?php
echo file_get_contents(
    'https://api.unoblox.ai/v1/chat/completions',
    false,
    stream_context_create([
        'http' => [
            'method'  => 'POST',
            'header'  => "Authorization: Bearer ub-gw-xxxxxxxxxxxxxxxx\r\nContent-Type: application/json",
            'content' => json_encode([
                'model' => 'openai/gpt-4.1',
                'messages' => [
                    ['role' => 'user', 'content' => 'Draft a polite refund confirmation email.'],
                ],
            ]),
        ],
    ])
);

In a real project you would capture the request context and response in ordinary variables and add error handling around a failed connection; this inlines everything into one expression just to show the full shape of the call in one place.

Choosing a model from a PHP backend

Use caseModel₹ per 1M tokens (input / output)
Background queue jobsDeepSeek V4 Flash₹9.07 / ₹18.14
Open-weight option with visionQwen3.8-27B₹16.32 / ₹48.96
Customer-facing chat widgetGPT-4.1₹201.6 / ₹806.4
Editorial-quality writingClaude Sonnet₹201.6 / ₹1008

For any model not listed here, see live ₹ pricing on /models before wiring it into a production controller.

Fitting this into a typical PHP stack

Whether you are on a plain LAMP stack, Laravel, or Symfony, the integration point is the same: wrap the HTTP call above, or the equivalent using curl or Guzzle, in a small service class, inject the base URL and key from your framework's configuration rather than hardcoding them inline, and log the model id and token usage alongside your existing application logs so cost is traceable per feature.

Frequently asked questions

Does this work with Laravel's HTTP client? Yes — Laravel's Http facade, built on Guzzle, can call the same endpoint with the same headers and JSON body; the request shape does not change based on which PHP HTTP layer sends it.

Do I need curl installed, or does file_get_contents work? Either works. file_get_contents with a stream context needs allow_url_fopen enabled; if that is disabled on your server, use the curl extension instead with the same headers and body.

Is my application data processed inside India? Only for the small unoblox-hosted models in the catalog; external models such as GPT and Claude run on their own infrastructure, with unoblox providing rupee billing and a GST invoice rather than India data residency for those.

How do I handle streaming responses in PHP? Read the response body incrementally rather than waiting for it to complete, using curl's streaming write-function callback or a chunked stream context, the same pattern used for any server-sent-events endpoint.

Can I test this without a production key? Yes, start against Qwen3 1.7B, which is free (₹0), to confirm your PHP code parses the response correctly before spending on a paid model.

Get started in rupees → https://unoblox.ai/sign-in

php ai api indiaintegrationsphp ai integrationopenai compatible api
ShareLinkedInWhatsAppTelegram

Start building in rupees

Call every major model through one OpenAI-compatible endpoint, billed in ₹ on a GST invoice.