TypeScript SDK
Official TypeScript SDK for the Banan0 API.
TypeScript SDK
Installation
npm install @banan0/sdkQuick Start
typescript
import { Banan0 } from '@banan0/sdk';
const client = new Banan0({
apiKey: process.env.BANAN0_API_KEY
});
// Generate an image
const run = await client.models.run('fal-ai/flux-pro', {
prompt: 'A banana astronaut'
});
// Wait for completion
const result = await client.runs.wait(run.id);
console.log(result.output.images);Available Methods
typescript
// Models
client.models.list({ category: 'image' });
client.models.get('fal-ai/flux-pro');
client.models.run('fal-ai/flux-pro', input);
// Runs
client.runs.get(runId);
client.runs.cancel(runId);
client.runs.wait(runId, { timeout: 60000 });
// Webhooks
client.webhooks.create({ url: '...' });
client.webhooks.list();
client.webhooks.delete(webhookId);
// Account
client.account.balance();With Webhooks
typescript
const run = await client.models.run('fal-ai/flux-pro', {
prompt: 'A banana spaceship'
}, {
webhookUrl: 'https://yoursite.com/webhook'
});*SDK coming soon! For now, use the REST API directly.*