Banana

REST API

← Back to Banana Docs

Start endpoint:

API Version 2

/start/v2

method: POST

input json:

{
    "id": "xyz", // **optional -** some uuid to identify the payload
    "created": 123123123123, // **optional -** the current Unix timestamp in seconds
    "apiKey": "your-auth-key", // **required -** your api key, for authorization
    "modelKey": "your-model-key", // **required -** the key giving you access to this model
    "modelInputs" : {
        ... // **required -** the json passed to the model inference server, previously called modelParameters
    },
}

return json:

{
    "id": "xyz" // the return payload id
    "message": "success", // success or server error messages. Our API does not throw 500 errors, so always check this field for the substring "error" to catch errors
    "created": 123123123123, // the current Unix timestamp in seconds
    "apiVersion": "Nov 14 2021", // identifier on which backend was used, to help us debug
    "callID": "call_abcabcabc" // the async call ID used on the /check/v2 call to see the task's status
}

Check endpoint:

/check/v2

method: POST

input json:

{
    "id": "xyz", // **optional -** some uuid to identify the payload
    "created": 123123123123, // **optional -** the current Unix timestamp in seconds
    "apiKey": "your-auth-key", // **required -** your api key, for authorization
    "longPoll": true, // **suggested -** a flag telling the REST call wait on the server for results, up to 50s
    "callID" : "call_abcabcabc" // **required -** the async task ID to fetch results for
}

return json:

{
    "id": "xyz" // the return payload id
    "message": "success", // success or server error messages. Our API does not throw 500 errors, so always check this field for the substring "error" to catch errors
    "created": 123123123123, // the current Unix timestamp in seconds
    "apiVersion": "Nov 14 2021", // identifier on which backend was used, to help us debug
    "modelOutputs": {
        ... // the json returned from the model inference server
    }
}

Because check is an async polling call, the status of the ongoing job will be displayed in the message field.

If message == "success", then the results will be found in the modelOutputs field.

If message contains "error", then the inference failed.

  • Errors will not throw an api-wide 500 error, as the check call technically was successful.
  • Make sure to watch for errors in the message field.