Recipe Image

The 'recipe-image' endpoint allows you to generate an image for a given recipes.

Introduction

This API allows you to generate images for a given recipe. It provides one endpoint that returns the result in JSON format.

Authentication

To access these endpoints, you must include an Authorization header with a valid API key.

Request Parameters

  • recipe (string, required): A statement describing the recipe you are creating an image for.
  • ingredients (array, required): An array of strings representing ingredients.

JSON Route Details

Endpoint

POST /api/generate/recipe-image

Request Example

POST /api/generate/recipe-image
Headers:
{
  "Authorization": "YOUR_API_KEY"
}
Body:
{
  "recipe": "Chiecken Rice",
  "ingredients": ["Chicken 500 grams","2 Cups of Rice "],

}

Response (JSON)

  • Status Code: 200 (OK)
  • Content-Type: application/json
{
  "imageUrl": "https://example.com/image.png",
}

Execution Time

Images are created by AI models at each request. Approximate time for response is 10s for the 'recipe-image' endpoint.

Error Responses

Both routes return specific error responses for various scenarios:

  • Missing API Key (Status Code: 403):
    • Response: No API Key in request
  • Invalid API Key (Status Code: 403):
    • Response: Invalid API Key
  • Missing Required Inputs (Status Code: 400):
    • Response: Required inputs not provided
  • Inactive Subscription (Status Code: 403):
    • Response: You don't have an active subscription