revideoz-sdk
v1.0.0
Published
TypeScript SDK for ReVideoz API
Readme
@revideoz/sdk
TypeScript SDK for the ReVideoz AI Video Analysis API.
Installation
npm install @revideoz/sdkQuick Start
import { ReVideoz } from '@revideoz/sdk';
const client = new ReVideoz({ apiKey: 'rvz_your_api_key' });
// Analyze video frames
const analysis = await client.analyze({
frames: [base64Frame1, base64Frame2],
aspectRatio: '16:9',
});
// Generate prompts
const prompts = await client.generatePrompt({
analysis: analysis.data,
promptTypes: ['video', 'image'],
targetModel: 'Midjourney',
resolution: '4K',
});
// Check credits
const { data } = await client.credits();
console.log(`Balance: ${data.balance} credits`);API Reference
new ReVideoz(config)
apiKey(required) - Your ReVideoz API keybaseUrl(optional) - API base URL (default: https://revideoz.com)
Methods
| Method | Description | Credits |
|--------|-------------|---------|
| analyze(params) | Analyze video frames | 2 |
| generatePrompt(params) | Generate AI prompts | 1/type |
| transcribe(params) | Transcribe audio | 1 |
| generateImage(params) | Generate image | 5 |
| credits() | Check balance | 0 |
| createKey(name?) | Create API key | 0 |
| listKeys() | List API keys | 0 |
| revokeKey(id) | Revoke API key | 0 |
Error Handling
import { ReVideozError } from '@revideoz/sdk';
try {
await client.analyze({ frames: [...] });
} catch (error) {
if (error instanceof ReVideozError) {
console.log(error.code); // 'INSUFFICIENT_CREDITS'
console.log(error.creditsRemaining); // 0
}
}