A lightweight, fluent PHP client for interacting with the Ovesio API and Ovesio AI platform.
To use this SDK, you must have an account on https://ovesio.com. After registration, you'll be able to:
- Create and manage projects
- Retrieve a unique API Key per project
- Monitor API usage and translation stats
👉 Each project has its own API key, which must be used in API requests. You can find it in your Ovesio dashboard under Settings → API Token.
composer require ovesio/ovesio-php- PHP >= 7.1
- cURL enabled
This library allows you to:
- Send translation requests to Ovesio
- Generate product descriptions using AI
- Generate SEO meta tags
- Retrieve translation/generation status
- List workflows
- List supported languages
- Handle asynchronous callbacks from Ovesio
use Ovesio\OvesioAI;
$client = new OvesioAI('YOUR_API_KEY');
$response = $client->translate()
->from('en')
->to(['fr', 'de'])
->workflow(1)
->data([
[
'key' => 'title',
'value' => 'Awesome Product',
'context' => 'E-commerce / Electronics'
],
[
'key' => 'desc',
'value' => '' // this will be filtered out if filterByValue() is called
]
], 'ref-123')
->filterByValue() // optional: remove empty values
->request();
print_r($response);$status = $client->translate()->status($response['data'][0]['id']);
print_r($status);$client->translate()
->from('en')
->to('fr')
->callbackUrl('https://yourdomain.com/callback')
->data([
[
'key' => 'name',
'value' => 'Modern Chair',
'context' => 'Furniture Product Title'
],
[
'key' => 'description',
'value' => '',
'context' => 'Product Description'
]
], 'product-102')
->filterByValue() // optional
->request();$client->generateDescription()
->workflow(2)
->to('en')
->data([
'name' => 'HP MT43 Laptop',
'categories' => ['Laptop', 'Second Hand'],
'description' => 'Compact, powerful and affordable.',
'additional' => [
'RAM: 8GB',
'Storage: 256GB SSD'
]
], 'ref-laptop')
->request();$client->generateSeo()
->workflow(3)
->to('en')
->data([
'name' => 'iPhone 14 Pro Max',
'categories' => ['Phones', 'Apple'],
'description' => 'Latest flagship Apple phone.',
'additional' => [
'Camera: 48MP',
'Chipset: A16 Bionic'
]
], 'ref-iphone')
->request();$workflows = $client->workflow()->list();$languages = $client->languages()->list();use Ovesio\Callback\CallbackHandler;
$callback = new CallbackHandler();
$data = $callback->handle();
if (!$data) {
$callback->fail('Invalid callback payload');
exit;
}
// process $data ...
$callback->success();All example files can be found in the /examples directory:
| File | Description |
|---|---|
translate.php |
Send a translation request and fetch status |
generate_description.php |
Generate product description and fetch status |
generate_seo.php |
Generate SEO meta tags and fetch status |
workflows.php |
List available workflows |
languages.php |
List available languages |
callback.php |
Handle and log Ovesio callback requests |
Ovesio https://ovesio.com
This SDK is open-sourced under the MIT license.