Links

Node

The official Node SDK documentation for Banana.

Get your Banana API Key

Sign in on the Banana user dashboard to get your api and model keys

Install the Banana Node SDK

From your terminal, run:
npm install @banana-dev/banana-dev

Run

const banana = require('@banana-dev/banana-dev');
​
const apiKey = "YOUR_API_KEY"
const modelKey = "YOUR_MODEL_KEY"
const modelParameters = {{YOUR_MODEL_INPUT_JSON}}
​
const out = await banana.run(apiKey, modelKey, modelParameters)

Output Json

Calls to banana return a json payload with the following structure
{
"id": "12345678-1234-1234-1234-123456789012",
"message": "success",
"created": 1649712752,
"apiVersion": "26 Nov 2021",
"modelOutputs": [
{
# a json specific to your model. In this example, the caption of the image
"caption": "a baseball player throwing a ball"
}
]
}
Last modified 1mo ago