Search by

runapi-ai / gemini-omni

runapi

RunAPI Gemini Omni Composer package for PHP applications

v0.5.0 2026-11-30 12:55 UTC

This package is auto-updated.

Last update: 2026-11-30 13:11:45 UTC


README

Packagist License

The Gemini Omni PHP SDK is the language-specific package for Gemini Omni on RunAPI. Use this package when your application needs Composer installs, associative-array request bodies, task status lookup, and consistent RunAPI errors in PHP.

This README is the PHP package guide for the public gemini-omni-php split repository. For model details, use https://runapi.ai/models/gemini-omni; for API reference, use https://runapi.ai/docs/api/gemini-omni/text-to-video; for SDK docs, use https://runapi.ai/docs/resources/sdks.

Install

composer require runapi-ai/gemini-omni

Quick start

<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\GeminiOmni\GeminiOmniClient;

$client = new GeminiOmniClient(); // reads RUNAPI_API_KEY

$createAudioResult = $client->createAudio->run([
    'model' => 'gemini-omni-audio',
    'audio_id' => 'zephyr',
    'example_dialogue' => 'sample',
    'name' => 'sample',
    'voice_description' => 'sample',
]);

$task = $client->textToVideo->create([
    'model' => 'gemini-omni-flash-1-1',
    'aspect_ratio' => '16:9',
    'audio_ids' => ['audio_1'],
    'character_ids' => ['character_1'],
    'duration_seconds' => 4,
    'first_frame_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
    'last_frame_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
    'output_resolution' => '720p',
    'prompt' => 'A precise product render on white marble',
    'reference_image_urls' => ['https://cdn.runapi.ai/public/samples/image.jpg'],
    'seed' => 1,
    'video_list' => [['url' => 'https://cdn.runapi.ai/public/samples/video.mp4', 'start' => 0, 'ends' => 4]],
]);

$status = $client->textToVideo->get($task->id);

$result = $client->textToVideo->run([
    'model' => 'gemini-omni-flash-1-1',
    'aspect_ratio' => '16:9',
    'audio_ids' => ['audio_1'],
    'character_ids' => ['character_1'],
    'duration_seconds' => 4,
    'first_frame_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
    'last_frame_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
    'output_resolution' => '720p',
    'prompt' => 'A serene mountain lake at dawn',
    'reference_image_urls' => ['https://cdn.runapi.ai/public/samples/image.jpg'],
    'seed' => 1,
    'video_list' => [['url' => 'https://cdn.runapi.ai/public/samples/video.mp4', 'start' => 0, 'ends' => 4]],
]);

echo $result->videos[0]->url . PHP_EOL;

Use create() to submit a task and return quickly, get() to fetch the latest task state, and run() when a script should create and poll until completion. In web request handlers, prefer create() plus webhook or later get() polling so a worker is not held open.

createAudio and createCharacter are synchronous resources and only expose run().

RunAPI-generated file URLs are temporary. Download and store generated files in your own durable storage within the retention window; do not treat returned URLs as long-term assets.

Language notes

Pass request parameters as associative arrays with snake_case keys. The available resources are textToVideo, extendVideo, createAudio, createCharacter. Keep RUNAPI_API_KEY in the environment or your secret manager; never commit API keys or callback secrets.

Flash 1.2 generation and continuation

Flash 1.2 uses model=gemini-omni-flash-1-2 and an integer duration_seconds from 3 through 15 for generation. Omit duration_seconds when editing with reference_video_urls; output duration follows the source video. When supplying both first and last frames, generation accepts 3 through 10 seconds. It accepts reference_image_urls with up to 6 images and reference_video_urls with up to 1 video. Images count as one reference slot and a video counts as two, with at most 7 slots total. Up to 2 account-owned character_ids consume no reference slots. Frame inputs cannot accompany reference inputs or characters. aspect_ratio also accepts auto, and seed is an integer from 10000 through 99999.

Continuation uses a completed Flash 1.2 generation or continuation task owned by your account. The source must be at most 15 seconds long at 360p or 720p. duration_seconds adds 3 through 10 seconds, and reference_image_urls accepts up to 3 images. The result contains the full original video plus the added segment. Retrieve its status with the continuation resource's get method.

$source = $client->textToVideo->run([
    'model' => 'gemini-omni-flash-1-2', 'prompt' => 'A paper airplane glides across a studio',
    'duration_seconds' => 7, 'output_resolution' => '720p',
]);
$continued = $client->extendVideo->run([
    'model' => 'gemini-omni-flash-1-2', 'source_task_id' => $source->id,
    'prompt' => 'Follow the airplane to the window', 'duration_seconds' => 3,
]);

Links

License

Licensed under the Apache License, Version 2.0.