Download the PHP package amirkateb/ai-core-client without Composer
On this page you can find all versions of the php package amirkateb/ai-core-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amirkateb/ai-core-client
More information about amirkateb/ai-core-client
Files in amirkateb/ai-core-client
Package ai-core-client
Short Description Official PHP and Laravel 8-13 SDK for KatebSaber AI Core Gateway
License MIT
Informations about the package ai-core-client
AI Core PHP SDK · v1.0.0
Official PHP client for KatebSaber AI Core Gateway — one durable API for multi-provider AI, queues, streaming, media, observability and Auto Switch failover profiles.
Laravel 8 → 13 · PHP 8.0+ · Framework-agnostic · cURL transport · Zero runtime dependency on a specific AI provider
Why this SDK?
Your application talks to one stable contract while AI Core handles provider routing, Xray/proxy policy, queues, retries, usage, logs and failover behind the gateway.
- Chat, Text, Responses, Vision, OCR, Image, Audio, Embeddings, Moderation, Rerank, Document and Video APIs
- Durable async requests with
RequestHandle - Resumable SSE with
Last-Event-ID - Batch requests and signed webhooks
- Per-company model allowlists and quotas
- Auto Switch profiles with ordered provider/model failover
- Full profile discovery, including every model inside a profile
- Laravel 8–13 auto-discovery, container binding and
AiCorefacade - Plain PHP usage with no Laravel dependency
Install
Requirements: PHP >=8.0 <9.0, ext-curl, ext-json and Composer 2.
60-second start
Auto Switch profiles
An Auto Switch profile is an ordered chain of 2–25 provider/model candidates. The gateway starts with candidate #1 and moves forward only when that candidate fails. Provider proxy rules are never bypassed: a provider configured for Xray stays fail-closed on Xray, then the profile advances to the next candidate.
Discover profiles and all models inside them
direct_access=false is intentional and important: if the company is allowed to use the profile but not an underlying model directly, that model can still run inside the profile only. Calling that same model directly with provider:model remains forbidden.
Run Chat through a profile
The same profile can be used for buffered text generation:
Stream a failover request
Auto Switch streaming is durable SSE at the gateway boundary. Provider candidates may be executed buffered when required by their managed proxy transport; the client still receives attempt events and the final response through the same resumable request stream.
Model discovery
models() includes individually allowed models plus any Auto Switch profiles explicitly allowed for the authenticated company.
Laravel 8–13
The package is auto-discovered by Laravel. No manual service provider registration is required.
Publish the config when you want an application-level file:
Dependency injection
Facade
The integration uses APIs shared across Laravel 8, 9, 10, 11, 12 and 13. The SDK itself does not require illuminate/*, so plain PHP and non-Laravel frameworks remain first-class.
Request lifecycle
Terminal states are success, failed and cancelled.
Files and media
For generated media:
Batch
Webhooks
Webhook request payloads expose model, resolved_model, and auto_switch details when a failover profile was used.
Error handling
Public SDK methods
| Area | Methods |
|---|---|
| Discovery | status, health, models, capabilities, usage, limits |
| Auto Switch | autoSwitchProfiles, autoSwitchProfile, chatWithProfile, chatStreamWithProfile, textWithProfile |
| Text | chat, chatStream, text, createResponse |
| Image/Vision | imageGeneration, imageEdit, visionAnalyze, ocr |
| Audio | audioAnalyze, speech, transcription, audioTranslation |
| Data/Safety | embeddings, moderation, rerank |
| Document/Video | documentAnalyze, videoAnalyze, videoGeneration |
| Request lifecycle | requests, request, cancelRequest, retryRequest, streamRequest, downloadMedia |
| Batch | batchBuilder, batches, createBatch, batch, cancelBatch |
Security model
- Keep API keys in backend secrets only.
- Auto Switch profile permission is independent from direct model permission.
- Allowing a profile does not expose its internal models for direct calls.
- Gateway re-checks profile permission when a queued request actually executes.
- Provider-specific Xray/proxy policy remains enforced for every candidate.
- Use idempotency keys for retryable business operations.
- Verify webhook signatures before side effects.
Versioning
This package follows Semantic Versioning. 1.0.0 is the first stable contract containing Auto Switch profile discovery/execution and Laravel 8–13 integration.
Package: amirkateb/ai-core-client
License: MIT
Gateway: https://ai.katebsaber.ir/api/v1
All versions of ai-core-client with dependencies
ext-curl Version *
ext-json Version *