Swaasth.ai Developer API
Integrate AI-powered nutrition and recipe generation into your applications.
Base URL
https://swaasth.supervity.ai/api/ai/recipesAuthentication
Public endpoints require no authentication.
Protected endpoints require a Bearer token in the Authorization header.
Authorization header
Authorization: Bearer YOUR_ACCESS_TOKENYour Bearer token
Extract Ingredients
https://swaasth.supervity.ai/api/ai/recipes/extract-ingredientsAccepts 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"Generate Recipes
https://swaasth.supervity.ai/api/ai/recipes/generateGenerates 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 Saved Recipes
https://swaasth.supervity.ai/api/ai/recipes/saved?lang=enReturns bookmarked recipes for the authenticated user.
Authentication: Bearer token required
Request
No request body.
Query: lang=en | hi | mrResponse
[
{
"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"Save Recipe
https://swaasth.supervity.ai/api/ai/recipes/saved?lang=enBookmarks 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 Saved Recipe
https://swaasth.supervity.ai/api/ai/recipes/saved/rec-a1b2c3d4Removes 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 Recipe History
https://swaasth.supervity.ai/api/ai/recipes/history?lang=enReturns previously generated recipes for the authenticated user.
Authentication: Bearer token required
Request
No request body.
Query: lang=en | hi | mrResponse
[
{
"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"