Cooking Assistant API (1.0.0)

Download OpenAPI specification:

API for recipe management and cooking assistance

Users

User auth and preferences

Register a new user

Request Body schema: application/json
required
username
required
string [ 1 .. 64 ] characters ^[a-zA-Z0-9_.-]+$

Alphanumeric, underscores, hyphens, and dots only

password
required
string [ 4 .. 128 ] characters

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Login and receive a JWT token

Request Body schema: application/json
required
username
required
string [ 1 .. 64 ] characters ^[a-zA-Z0-9_.-]+$

Alphanumeric, underscores, hyphens, and dots only

password
required
string [ 4 .. 128 ] characters

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

Logout

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Get current user profile and preferences

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "preferences": {
    }
}

Update user profile and preferences

Authorizations:
bearerAuth
Request Body schema: application/json
required
username
string [ 1 .. 64 ] characters ^[a-zA-Z0-9_.-]+$

Alphanumeric, underscores, hyphens, and dots only

password
string [ 4 .. 128 ] characters
object (UserPreferences)

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "preferences": {
    }
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Delete current user account and all associated recipes (cascade)

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Recipes

Recipe storage and retrieval

List all recipes saved by the current user

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Save a recipe to the current user's collection

Authorizations:
bearerAuth
Request Body schema: application/json
required
title
required
string [ 1 .. 255 ] characters
required
Array of objects (RecipeIngredient) non-empty
instructions
required
Array of strings non-empty [ items non-empty ]
portions
required
number >= 0.5
object (RecipeNutrients)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "ingredients": [
    ],
  • "instructions": [
    ],
  • "portions": 0.5,
  • "nutrients": {
    }
}

Response samples

Content type
application/json
{
  • "id": 1
}

Get a specific recipe by ID

Authorizations:
bearerAuth
path Parameters
recipeId
required
integer <int64> >= 1

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "ingredients": [
    ],
  • "instructions": [
    ],
  • "portions": 0.5,
  • "nutrients": {
    },
  • "id": 1,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "editedAt": "2019-08-24T14:15:22Z",
  • "openedAt": "2019-08-24T14:15:22Z"
}

Update a saved recipe by ID

Authorizations:
bearerAuth
path Parameters
recipeId
required
integer <int64> >= 1
Request Body schema: application/json
required
title
string [ 1 .. 255 ] characters
Array of objects (RecipeIngredient) non-empty
instructions
Array of strings non-empty [ items non-empty ]
portions
number >= 0.5
object (RecipeNutrients)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "ingredients": [
    ],
  • "instructions": [
    ],
  • "portions": 0.5,
  • "nutrients": {
    }
}

Response samples

Content type
application/json
{
  • "title": "string",
  • "ingredients": [
    ],
  • "instructions": [
    ],
  • "portions": 0.5,
  • "nutrients": {
    },
  • "id": 1,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "editedAt": "2019-08-24T14:15:22Z",
  • "openedAt": "2019-08-24T14:15:22Z"
}

Delete a saved recipe by ID

Authorizations:
bearerAuth
path Parameters
recipeId
required
integer <int64> >= 1

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

AI

AI-powered generation and assistance

Generate recipes using an LLM based on a prompt

Authorizations:
bearerAuth
Request Body schema: application/json
required
prompt
required
string [ 1 .. 4096 ] characters
language
string (Language)
Enum: "EN" "DE" "HU"

Active UI language; generated recipe content is written in it

Responses

Request samples

Content type
application/json
{
  • "prompt": "string",
  • "language": "EN"
}

Response samples

Content type
application/json
[
  • {
    }
]

Generate nutritional information for a recipe using an LLM

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object (RecipeInput)

Responses

Request samples

Content type
application/json
{
  • "recipe": {
    }
}

Response samples

Content type
application/json
{
  • "calories": 0,
  • "protein": 0,
  • "fat": 0,
  • "carbs": 0
}

Ask the LLM a question about a recipe

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object (RecipeInput)
prompt
required
string [ 1 .. 4096 ] characters

Responses

Request samples

Content type
application/json
{
  • "recipe": {
    },
  • "prompt": "string"
}

Response samples

Content type
application/json
{
  • "response": "string"
}