Foods
Function-calling namespace: foods
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
analyze
Source: backend/endpoints/foods/analyze
Input Fields
| Field | Type | Required |
|---|---|---|
image_url | string | No |
image_base64 | string | No |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "analyze",
"data": {
"image_url": "value",
"image_base64": "value"
}
}'Example Response
{ "status": "ok", "data": {} }bulk
Source: backend/endpoints/foods/bulk
Input Fields
| Field | Type | Required |
|---|---|---|
items | []FoodItem | Yes |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "bulk",
"data": {
"items": []
}
}'Example Response
{ "status": "ok", "data": {} }create
Source: backend/endpoints/foods/create
Input Fields
| Field | Type | Required |
|---|---|---|
name | string | Yes |
category | string | No |
calories | int | No |
protein | float64 | No |
carbs | float64 | No |
fat | float64 | No |
fiber | float64 | No |
serving_size | string | No |
ingredients | []string | No |
image_url | string | No |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "create",
"data": {
"name": "value"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/foods/delete
Input Fields
| Field | Type | Required |
|---|---|---|
id | string | Yes |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "delete",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }get
Source: backend/endpoints/foods/get
Input Fields
| Field | Type | Required |
|---|---|---|
id | string | Yes |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "get",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }list
Source: backend/endpoints/foods/list
Input Fields
| Field | Type | Required |
|---|---|---|
page | int | No |
page_size | int | No |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "list",
"data": {
"page": 1,
"page_size": 1
}
}'Example Response
{ "status": "ok", "data": {} }search
Source: backend/endpoints/foods/search
Input Fields
| Field | Type | Required |
|---|---|---|
query | string | No |
category | string | No |
min_calories | int | No |
max_calories | int | No |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "search",
"data": {
"query": "value",
"category": "value",
"min_calories": 1,
"max_calories": 1
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/foods/update
Input Fields
| Field | Type | Required |
|---|---|---|
id | string | Yes |
name | *string | No |
category | *string | No |
calories | *int | No |
protein | *float64 | No |
carbs | *float64 | No |
fat | *float64 | No |
fiber | *float64 | No |
serving_size | *string | No |
ingredients | *[]string | No |
image_url | *string | No |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "foods",
"apiName": "update",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }