Swaasth.ai Developer API

Integrate AI-powered nutrition and recipe generation into your applications.

Base URL

https://swaasth.supervity.ai/api/ai/recipes

Authentication

Public endpoints require no authentication.

Protected endpoints require a Bearer token in the Authorization header.

Authorization header

Authorization: Bearer YOUR_ACCESS_TOKEN

Your Bearer token

POST

Extract Ingredients

https://swaasth.supervity.ai/api/ai/recipes/extract-ingredients

Accepts a food image and returns ingredient names in plain English.

Authentication: None required

Request

multipart/form-data

file: image file (jpeg, png, or webp)

Response

{
  "ingredients": [
    "tomato",
    "onion",
    "spinach"
  ]
}
curl "text-brand-cornflower">-X POST "https://swaasth.supervity.ai/api/ai/recipes/extract">-ingredients" \
  "text-brand-cornflower">-F "file=@/path/to/ingredients.jpg"
POST

Generate Recipes

https://swaasth.supervity.ai/api/ai/recipes/generate

Generates nutritionally optimized recipes from available ingredients.

Authentication: None required (optional Bearer token saves recipe history)

Request

{
  "ingredients": [
    "tomato",
    "spinach",
    "lentils"
  ],
  "lang": "en"
}

Response

{
  "recipes": [
    {
      "id": "rec-a1b2c3d4",
      "name": "Spinach Dal",
      "difficulty": "Easy",
      "prep_time_mins": 10,
      "cook_time_mins": 25,
      "serving_size": 4,
      "ingredients": [
        {
          "name": "Spinach",
          "quantity": "2 cups"
        }
      ],
      "instructions": [
        "Wash and soak lentils."
      ],
      "nutrition_highlights": [
        "Rich in Iron"
      ]
    }
  ],
  "recipes_raw": []
}
curl "text-brand-cornflower">-X POST "https://swaasth.supervity.ai/api/ai/recipes/generate" \
  "text-brand-cornflower">-H "Content">-Type: application/json" \
  "text-brand-cornflower">-d '{"ingredients":["tomato","spinach","lentils"],"lang":"en"}'
GET

Get Saved Recipes

https://swaasth.supervity.ai/api/ai/recipes/saved?lang=en

Returns bookmarked recipes for the authenticated user.

Authentication: Bearer token required

Request

No request body.

Query: lang=en | hi | mr

Response

[
  {
    "id": 42,
    "recipe_id": "rec-a1b2c3d4",
    "recipe_data": {
      "id": "rec-a1b2c3d4",
      "name": "Spinach Dal"
    },
    "created_at": "2026-06-15T10:30:00+00:00"
  }
]
curl "text-brand-cornflower">-X GET "https://swaasth.supervity.ai/api/ai/recipes/saved?lang=en" \
  "text-brand-cornflower">-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
POST

Save Recipe

https://swaasth.supervity.ai/api/ai/recipes/saved?lang=en

Bookmarks a recipe for the authenticated user.

Authentication: Bearer token required

Request

{
  "recipe_id": "rec-a1b2c3d4",
  "recipe_data": {
    "id": "rec-a1b2c3d4",
    "en": {},
    "hi": {},
    "mr": {}
  }
}

Response

{
  "id": 42,
  "recipe_id": "rec-a1b2c3d4",
  "recipe_data": {
    "id": "rec-a1b2c3d4",
    "name": "Spinach Dal"
  },
  "created_at": "2026-06-15T10:30:00+00:00"
}
curl "text-brand-cornflower">-X POST "https://swaasth.supervity.ai/api/ai/recipes/saved?lang=en" \
  "text-brand-cornflower">-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "text-brand-cornflower">-H "Content">-Type: application/json" \
  "text-brand-cornflower">-d '{"recipe_id":"rec">-a1b2c3d4","recipe_data":{...}}'
DELETE

Delete Saved Recipe

https://swaasth.supervity.ai/api/ai/recipes/saved/rec-a1b2c3d4

Removes a bookmarked recipe for the authenticated user.

Authentication: Bearer token required

Request

No request body.

Path: recipe_id (e.g. rec-a1b2c3d4)

Response

{
  "status": "success",
  "message": "Recipe removed from bookmarks."
}
curl "text-brand-cornflower">-X DELETE "https://swaasth.supervity.ai/api/ai/recipes/saved/rec">-a1b2c3d4" \
  "text-brand-cornflower">-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
GET

Get Recipe History

https://swaasth.supervity.ai/api/ai/recipes/history?lang=en

Returns previously generated recipes for the authenticated user.

Authentication: Bearer token required

Request

No request body.

Query: lang=en | hi | mr

Response

[
  {
    "id": 101,
    "ingredients": [
      "tomato",
      "spinach",
      "lentils"
    ],
    "recipe_data": {
      "id": "rec-a1b2c3d4",
      "name": "Spinach Dal"
    },
    "created_at": "2026-06-15T10:30:00+00:00"
  }
]
curl "text-brand-cornflower">-X GET "https://swaasth.supervity.ai/api/ai/recipes/history?lang=en" \
  "text-brand-cornflower">-H "Authorization: Bearer YOUR_ACCESS_TOKEN"