Endpoint
POST
/functions/v1/decideContract
Send mymolecules-api-version with 2026-07-10 to use the documented response contract.
{
"data": {},
"meta": {
"request_id": "req_...",
"api_version": "2026-07-10"
}
}Headers
Request
x-api-keyrequired - Server-side API key for your integration.mymolecules-api-versionrequired2026-07-10- Use the latest stable API version: 2026-07-10.Content-Typerequiredapplication/json- Required for JSON request bodies.
Response
x-request-idrequired - Request identifier. Log this value when contacting support.mymolecules-api-versionrequired2026-07-10- The API contract version used for the response.x-ratelimit-limitoptional - Quota limit for the current key and window when quota data is available.x-ratelimit-remainingoptional - Remaining requests in the current quota window when quota data is available.x-ratelimit-resetoptional - ISO timestamp for the current quota window reset when quota data is available.retry-afteroptional - Seconds to wait before retrying when the request is rate-limited or temporarily unavailable.
Inputs
- inputs[] with one or more text, image or audio entries
- Each input requires type and data; label and mime_type are optional
Returns
- Synchronous 200 response with status completed
- result.answer_text with the recommendation
- Structured failed response for validation or upstream errors
Error codes
missing_api_keyinvalid_api_keyscope_not_allowedquota_exceededinvalid_jsoninvalid_requestvalidation_errormethod_not_allowedunsupported_api_versionjob_not_foundbacklog_highupstream_timeoutupstream_errorinternal_error
Request details
- Use inputs[] with typed text, image or audio entries. Top-level input_type, data and audio_format are not part of the documented contract.
- Text data must be non-empty; image data should be an image URL or supported image data URL; audio data should include mime_type when ambiguous.
- Put current preferences, conditions or decision context in a text input.
Response details
- No polling is required for Decide.
- Successful responses always contain status: completed, result.answer_text and error: null.
- Failed responses contain status: failed, result: null and an error object.
Operational notes
- Requires x-api-key with the edge:decide scope.
- Usage is counted and rate-limit headers are returned when quota data is available.
- The API is scoped to concrete nutrition decisions between explicit options.
Examples
Request JSON
{
"inputs": [
{
"type": "text",
"label": "meal options",
"data": "Option A: oatmeal with berries. Option B: croissant and jam."
},
{
"type": "text",
"label": "decision context",
"data": "Prefer steady energy"
}
]
}Response JSON
{
"data": {
"status": "completed",
"result": {
"answer_text": "Choose option A. It is more likely to provide steady energy."
},
"error": null
},
"meta": {
"request_id": "req_...",
"api_version": "2026-07-10"
}
}Code examples
curl -X POST 'https://api.mymolecules.de/functions/v1/decide' \
-H 'x-api-key: $MYMOLECULES_API_KEY' \
-H 'mymolecules-api-version: 2026-07-10' \
-H 'Content-Type: application/json' \
--data '{ "inputs": [ { "type": "text", "label": "meal options", "data": "Option A: oatmeal with berries. Option B: croissant and jam." }, { "type": "text", "label": "decision context", "data": "Prefer steady energy" } ]}'


