0.2.1 • Published 8 months ago
openpixels v0.2.1
OpenPixels TypeScript/JavaScript SDK
A TypeScript SDK for accessing the OpenPixels API.
Installation
npm install openpixels
# or
yarn add openpixels
# or
pnpm add openpixelsUsage
import { OpenPixels } from 'openpixels';
const client = new OpenPixels({
apiKey: 'sk-op-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
});
// Generate an image
async function generateImage() {
const result = await client.run({
model: 'flux-dev',
prompt: 'a cat',
});
console.log(result);
}
generateImage();API Reference
OpenPixels
The main client for making synchronous calls to the OpenPixels API.
const client = new OpenPixels({
apiKey: "YOUR_API_KEY",
baseUrl: "https://worker.openpixels.ai" // Optional, defaults to production API
});Methods
run(payload): Submits a job and waits for the result.
Publish a New Version
- Bump the version in the
package.jsonfile git tag vX.Y.Zgit push origin vX.Y.Zpnpm buildpnpm publish
License
MIT # openpixels-node