Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs(ai-gateway): document video generation
The gateway serves OpenAI's video endpoints alongside chat completions and
images, so add a Video section and an example to the aiGateway JSDoc, and
point them at the new guide for the model list and request options.

Video generation is asynchronous and has no `automatic` model, which is the
part most likely to trip someone up, so both are called out in the summary
rather than left to the guide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
  • Loading branch information
wixysam and claude committed Oct 5, 2026
commit a8ced71b6d2258faadc81622e65134c5619d80b9
37 changes: 36 additions & 1 deletion packages/sdk/src/modules/ai-gateway.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface AiGatewayModuleConfig {
*
* `connection()` takes an optional `provider`, and each provider serves a different API:
*
* - `openai` (default): OpenAI-compatible chat completions and image endpoints.
* - `openai` (default): OpenAI-compatible chat completions, image, and video endpoints.
* - `typesafe`: structured evaluations with the `jev` model.
*
* Call `connection()` from a backend function rather than the browser. This
Expand All @@ -79,6 +79,17 @@ export interface AiGatewayModuleConfig {
* `'gemini_3_1_flash_image'` or `'gpt_image_2'`. For request options, the
* full model list, and limits, see [Generate images with the AI Gateway](/developers/references/sdk/getting-started/ai-gateway-images).
*
* ## Video
*
* The gateway also serves OpenAI's video endpoints, `/videos`, so you can
* generate video from a prompt, from a still image, or from existing media.
* Video generation is asynchronous: `POST /videos` returns a job, and you poll
* `GET /videos/{id}` until its status is `completed` or `failed`, which can
* take minutes. Video models are their own set, and there's no `automatic`
* option, so pin a model such as `'veo_3_1_fast'` or `'seedance_2'`. For
* request options, the full model list, and limits, see
* [Generate video with the AI Gateway](/developers/references/sdk/getting-started/ai-gateway-video).
*
* ## Structured evaluations
*
* The `typesafe` provider runs the `jev` evaluation model through
Expand Down Expand Up @@ -203,6 +214,30 @@ export interface AiGatewayModule {
*
* @example
* ```typescript
* // Start a video and record the job to poll later
* import { createClientFromRequest } from "@base44/sdk";
*
* // Runs inside a backend function
* const base44 = createClientFromRequest(request);
* const { baseURL, token, headers } = base44.asServiceRole.aiGateway.connection();
*
* const response = await fetch(`${baseURL}/videos`, {
* method: "POST",
* headers: { ...headers, Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
* body: JSON.stringify({
* model: "veo_3_1_fast",
* prompt: "A lighthouse beam sweeping across a calm sea at dawn",
* seconds: 8,
* }),
* });
*
* // Video generation takes minutes, so store the id and poll it from a later request
* const { id } = await response.json();
* await base44.asServiceRole.entities.Clip.update(clipId, { video_id: id });
* ```
*
* @example
* ```typescript
* // Route a support ticket with a structured evaluation
* import { createClientFromRequest } from "@base44/sdk";
* import { experimental_evaluate as evaluate } from "ai";
Expand Down
Loading