1. Calling the API
Use the Higgsfield client to call Genjutsu Object Swap from your application.
Install
Choose the installation method for your selected client. cURL does not require a client package.
npm install @higgsfield-ai/clientSetup
Create a client and submit input to the model endpoint.
import { HiggsfieldClient } from '@higgsfield-ai/client'
const client = new HiggsfieldClient({
apiKey: process.env.HIGGSFIELD_API_KEY,
})2. Authentication
API Key
Pass your API key through the client configuration or the authorization header.
Authorization: Bearer $HIGGSFIELD_API_KEYKeep API keys on the server and never expose them in browser code.
3. Queue
Model requests run asynchronously. Submit a request, then fetch it until it reaches a terminal state.
Submit
const request = await client.submit('higgsfiled/genjutsu/object-swap/v1.0', {
prompt: 'A cinematic portrait in soft natural light',
})Fetch
const result = await client.requests.get(request.id)