Node
The official Node SDK documentation for Banana.
From your terminal, run:
npm install @banana-dev/banana-dev
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)
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