Projects

Projects are the core of Banana. On this page, we'll dive into the different project endpoints that you can use to manage projects programmatically.

The project resource

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the project.

  • Name
    teamId
    Type
    string
    Description

    The identifier of the team that the project belongs to.

  • Name
    minReplicas
    Type
    integer
    Description

    The minimum number of replicas that must be available at all times.

  • Name
    maxReplicas
    Type
    integer
    Description

    The maximum number of replicas that can be used for inference at any given time.

  • Name
    inferenceTimeout
    Type
    integer
    Description

    How many seconds to wait for the inference task to complete before timing out.

  • Name
    idleTimeout
    Type
    integer
    Description

    How many seconds to wait for the model to be offloaded from GPU after the current inference is completed. The model is "warm" for this period of time and can be re-used without a cold boot.


GET/v1/projects

List all projects

This endpoint allows you to retrieve a list of all your projects.

Example Request

GET
/v1/projects
curl -G https://api.banana.dev/v1/projects \
  -H 'X-Banana-API-Key 73323b18-308d-4b23-8b75-37c48c48cea5'

Example Response

{
  "results": [
    {
      "id": "2fdbe58d-592f-4e3d-8da3-d56292f6ae04",
      "teamId": "8478e1ff-b8dd-4226-ba2e-8f47ca82769f",
      "minReplicas": 0,
      "maxReplicas": 3,
      "inferenceTimeout": 300,
      "idleTimeout": 30
    },
    {
      "id": "631df549-b860-4089-8382-66224f0877b9"
      // ...
    }
  ]
}
GET/v1/projects/:id

Retrieve a project

This endpoint allows you to retrieve a project by providing its id. Refer to the list at the top of this page to see which properties are included with project objects.

Example Request

GET
/v1/projects/:id
curl -G https://api.banana.dev/v1/projects/2fdbe58d-592f-4e3d-8da3-d56292f6ae04 \
  -H 'X-Banana-API-Key: 73323b18-308d-4b23-8b75-37c48c48cea5'

Example Response

{
  "id": "2fdbe58d-592f-4e3d-8da3-d56292f6ae04",
  "teamId": "8478e1ff-b8dd-4226-ba2e-8f47ca82769f",
  "minReplicas": 0,
  "maxReplicas": 3,
  "inferenceTimeout": 300,
  "idleTimeout": 30
}

PUT/v1/projects/:id

Update a project

This endpoint allows you to perform an update on a projext with the attributes supported below.

Optional attributes

You can provide one or more of the following attributes in your request.

  • Name
    minReplicas
    Type
    integer
    Description

    The minimum number of replicas that must be available at all times.

  • Name
    maxReplicas
    Type
    integer
    Description

    The maximum number of replicas that can be used for inference at any given time.

  • Name
    inferenceTimeout
    Type
    integer
    Description

    How many seconds to wait for the inference task to complete before timing out.

  • Name
    idleTimeout
    Type
    integer
    Description

    How many seconds to wait for the model to be offloaded from GPU after the current inference is completed. The model is "warm" for this period of time and can be re-used without a cold boot.

Example Request

PUT
/v1/projects/:id
curl -X PUT https://api.banana.dev/v1/projects/2fdbe58d-592f-4e3d-8da3-d56292f6ae04 \
  -H 'X-Banana-API-Key 73323b18-308d-4b23-8b75-37c48c48cea5' \
  -H 'Content-Type: application/json' \
  -d '{"minReplicas": 1, "idleTimeout": 10}'

Example Response

{
  "id": "2fdbe58d-592f-4e3d-8da3-d56292f6ae04",
  "teamId": "8478e1ff-b8dd-4226-ba2e-8f47ca82769f",
  "minReplicas": 1,
  "maxReplicas": 3,
  "inferenceTimeout": 300,
  "idleTimeout": 10
}