Docs/APIs/Recipe Generator

Recipe Generator

Generate recipes with AI

OperationalCredits 2 per callp50 1608msFoodStar

Overview

Recipe Generator passes the `name` parameter to a Gemini language model as "Generate a recipe for: " followed by your text, with instructions to be specific about measurements and steps and to answer in English whatever the input language. The model must return JSON that fits a fixed schema, which the API copies field by field into the response.

`name` is the dish title the model chose, which may be tidier or more specific than your input. `description` is a short summary of the dish. `ingredients` is an array of plain strings, each combining quantity, unit and item, such as "1 red bell pepper, sliced"; quantities are not split into separate numeric fields. `instructions` is a single string of steps, numbered and separated by line breaks in typical output. `prep_time` and `cook_time` are free-text durations such as "15 minutes", not numbers. `servings` is an integer.

The model runs at temperature 0.7 with top-p and top-k sampling, so repeated calls for the same dish produce different recipes. Output is capped at 1,000 tokens, which suits everyday dishes; very elaborate requests get a condensed recipe. Units are whatever the model chooses for the dish and are not converted or checked.

Input that fails the text safety check is rejected with a 400 before the model is called, and an empty model reply returns a 500. The recipe is generated text, not a tested recipe: cooking times, temperatures and allergen information should be reviewed before you publish them. There are no plan-dependent fields.

Live Test Recipe Generator API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/recipe
curl "https://api.apiverve.com/v1/recipe?name=chicken%20fajitas" \
  -H "x-api-key: your_api_key_here"

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
nameRequiredstringThe name or description of the recipe you want to generate
length 0–200

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "name": "Chicken Fajitas",
    "description": "A flavorful and easy-to-make dish with marinated chicken, bell peppers, and onions, served with warm tortillas.",
    "ingredients": [
      "1.5 pounds boneless, skinless chicken breasts, sliced",
      "1 red bell pepper, sliced",
      "1 green bell pepper, sliced",
      "1 large onion, sliced",
      "2 tablespoons olive oil",
      "1 packet (1 ounce) fajita seasoning",
      "1/2 cup water",
      "12 flour tortillas",
      "Optional toppings: sour cream, guacamole, salsa, shredded cheese"
    ],
    "instructions": "1. In a bowl, combine chicken with fajita seasoning and water. Marinate for at least 15 minutes.\n2. Heat olive oil in a large skillet or cast-iron pan over medium-high heat.\n3. Add the chicken and coo…",
    "prep_time": "15 minutes",
    "cook_time": "20 minutes",
    "servings": 4
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
namestring"Chicken Fajitas"The name of the generated recipe dish
descriptionstring"A flavorful and easy-to-make dish with marinated chicken, bell peppers, and onions, served with warm…"Detailed description of the recipe including flavor profile and preparation method
ingredientsarray[1.5 pounds boneless, skinless chicken breasts, sliced, ...]List of ingredients with quantities required for the recipe
instructionsstring"1. In a bowl, combine chicken with fajita seasoning and water. Marinate for at least 15 minutes. 2.…"Step-by-step cooking instructions for preparing the recipe
prep_timestring"15 minutes"Time required to prepare ingredients before cooking begins
cook_timestring"20 minutes"Time required to cook the recipe from start to finish
servingsnumber4Number of people the recipe serves

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Meal Planning Calendars
Meal planning platforms generate weekly dinner schedules by passing suggested dish names and populating shopping lists with the returned ingredient quantities.
Smart Kitchen Displays
When a cook selects a dish on a connected appliance, the interface displays ordered preparation instructions paired with active prep and cook timers.
Grocery Delivery Carts
Supermarket apps turn customer meal requests into full ingredient lists with quantities, adding every required item directly to the digital shopping basket.
Fitness Calorie Trackers
To help users log homemade meals accurately, nutrition logs look up dish concepts to retrieve exact ingredients and estimated serving sizes.

Other ways to use Recipe Generator

Set up Recipe Generator on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →
Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheets →Reference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContext →Reference →

More in Food:

Was this page helpful?