OpenAI SDK
Use the official OpenAI SDK with Pipevideo as a drop-in base URL replacement.
If you have existing code built on the OpenAI SDK, point it at Pipevideo to access video generation. Pipevideo uses the Responses API shape — use client.responses.create rather than client.chat.completions.create.
TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.pipevideo.co/v1",
apiKey: process.env.PIPEVIDEO_API_KEY,
defaultHeaders: {
"HTTP-Referer": "https://myapp.com",
"X-Pipevideo-Title": "My Video App",
},
});
const response = await client.responses.create({
model: "moonshotai/kimi-k2.5",
input: "Animated logo with pulsing circles",
});
console.log(response.id, response.status);Poll for the result:
const result = await client.responses.retrieve(response.id);
console.log(result.output_video_url);Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.pipevideo.co/v1",
api_key="pv_your_api_key",
)
response = client.responses.create(
model="moonshotai/kimi-k2.5",
input="Animated logo with pulsing circles",
extra_headers={
"HTTP-Referer": "https://myapp.com",
"X-Pipevideo-Title": "My Video App",
},
)
print(response.id, response.status)Differences from OpenAI
| OpenAI | Pipevideo |
|---|---|
Text in output_text | Video URL in output_video_url |
| Synchronous or streaming text | Async — poll or use webhooks |
model is a chat model | model is an orchestration LLM id |
| Per-token or per-request pricing | Token-based orchestration billing |
Recommended alternative
For the best experience with polling, waiting, and typed video responses, use the official TypeScript SDK (npm install pipevideo).
Related
- App attribution — optional headers for rankings
- Responses API — full HTTP reference