0.2.1 • Published 4 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 openpixels
Usage
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.json
file git tag vX.Y.Z
git push origin vX.Y.Z
pnpm build
pnpm publish
License
MIT # openpixels-node