Skip to content
GET/v1/functions

List every callable function.

Every function of every adapter the server's engine currently serves and that has a manifest in the server's catalogue (an adapter the engine serves without a manifest is not listed: without it, nothing can call it).

Responses

200The functions this server can decide.
Response schema
{
  "title": "Jeff GET /v1/functions response",
  "description": "Every function of every adapter the server's engine has loaded, with what a caller needs to call it (the same fields as the adapter's manifest), and the weight format of the base it serves.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "base_format",
    "functions"
  ],
  "properties": {
    "base_format": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "format"
      ],
      "description": "The weight format of the base the server's engines serve (as their health's base.format and base.format_id): {\"format\": \"bf16\"}, or for an INT4 base {\"format\": \"int4-g64\", \"format_id\": <that INT4 base's name>}. On an INT4 base a function decides with its calibration_by_format entry for format_id, not with calibration.",
      "properties": {
        "format": {
          "type": "string",
          "minLength": 1
        },
        "format_id": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "functions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "interface",
          "type",
          "labels",
          "context",
          "input",
          "calibration",
          "adapter_version",
          "licence"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The function's own ID: the adapter's ID, a dot, the function's key."
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The other references that name this function: each of its adapter's aliases (in its manifest's order), a dot and the function's key, for example jeff.routing.router-open.specialist for jeff.routing.router-open-v14.specialist, or spam.is_spam for jeff.safety.spam.is_spam. A decision made through one of them still reports id. This server always sends it; it is not required, so a client still reads the answer of a server from before the field (read a missing one as an empty list)."
          },
          "interface": {
            "type": "string"
          },
          "type": {
            "enum": [
              "choice",
              "noul",
              "score"
            ]
          },
          "labels": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "source"
            ],
            "properties": {
              "source": {
                "enum": [
                  "fixed",
                  "caller",
                  "subset",
                  "describe"
                ],
                "description": "fixed: the labels are always 'fixed'. caller: the caller passes its own labels (a key -> description object), listed after 'fixed_first' and renamed to 'caller_keys' on the wire when set. subset: 'fixed' holds every allowed label and the caller passes the list of keys to offer, which must include 'required'. describe: the keys are always 'keys', in that order, and the caller passes an object with exactly those keys whose values are the descriptions."
              },
              "fixed": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "levels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 2,
                "maxItems": 10
              },
              "fixed_first": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "caller_keys": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[a-z]+\\{n\\}$"
              },
              "max": {
                "type": "integer",
                "minimum": 1,
                "maximum": 255
              },
              "required": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "subset: keys the caller must always offer."
              },
              "keys": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "describe: the fixed keys, in the trained order."
              },
              "subset": {
                "type": "boolean",
                "description": "Required for fixed labels of a choice function, and absent everywhere else. false: the caller passes no labels, and every fixed label is offered. true: the caller may pass labels as a non-empty list of fixed keys (no repeats) to offer only those, listed in the order of 'fixed' with their fixed descriptions; without labels, every fixed label is offered."
              }
            }
          },
          "context": {
            "allOf": [
              {
                "type": "array",
                "description": "The context fields: values a caller binds once and that Jeff sends before the input, in this order.",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "description",
                    "required"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60,
                      "pattern": "^(?![\\u0020\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff])(?![\\s\\S]*[\\u0020\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]$)(?![\\s\\S]*[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029])",
                      "description": "A context or input field's key exactly as the adapter was trained on it, and as the prompt shows it: any printable text of 1 to 60 characters (for example 'counterparty name'). Refused: control characters and the Unicode line and paragraph separators (U+2028, U+2029) anywhere, and a whitespace character at either end: the space, the no-break spaces (U+00A0, U+202F), every other Unicode space separator (U+1680, U+2000 to U+200A, U+205F, U+3000) and the byte order mark (U+FEFF). Whitespace other than those separators may appear inside a key. Callers never use it; they use the field's code name."
                    },
                    "code_name": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]*$",
                      "description": "The name callers use for a context field: SDK context, HTTP and channel context keys, MCP tool arguments and the function listing. Absent: a key of the form ^[a-z][a-z0-9_]*$ is its own code name, unchanged, as before code names existed; any other key is lower-cased, with every run of characters other than a-z and 0-9 replaced by one underscore and underscores trimmed from both ends ('counterparty name' -> counterparty_name). Declare it when that rule gives no name of the form ^[a-z][a-z0-9_]*$. Two fields of one manifest (context and input together) may not share a code name. The input's code_name takes part only in that check (and is listed by GET /v1/functions): callers always pass the input as 'input'."
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "required": {
                      "type": "boolean"
                    }
                  }
                }
              },
              {
                "type": "array",
                "items": {
                  "required": [
                    "code_name"
                  ]
                }
              }
            ],
            "description": "The function's context fields (its own when the manifest declares them for the function, else the adapter's), each with its code_name always given (declared or derived): callers pass context by code name; key is the field as the prompt shows it."
          },
          "input": {
            "allOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "key",
                  "description",
                  "form"
                ],
                "description": "The input: the one value a caller passes with every call (as 'input'), as opposed to the context, which is bound once. Its form says how the adapter was trained to see it, and so what Jeff sends the model.",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "pattern": "^(?![\\u0020\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff])(?![\\s\\S]*[\\u0020\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]$)(?![\\s\\S]*[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029])",
                    "description": "A context or input field's key exactly as the adapter was trained on it, and as the prompt shows it: any printable text of 1 to 60 characters (for example 'counterparty name'). Refused: control characters and the Unicode line and paragraph separators (U+2028, U+2029) anywhere, and a whitespace character at either end: the space, the no-break spaces (U+00A0, U+202F), every other Unicode space separator (U+1680, U+2000 to U+200A, U+205F, U+3000) and the byte order mark (U+FEFF). Whitespace other than those separators may appear inside a key. Callers never use it; they use the field's code name."
                  },
                  "code_name": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]*$",
                    "description": "The name callers use for a context field: SDK context, HTTP and channel context keys, MCP tool arguments and the function listing. Absent: a key of the form ^[a-z][a-z0-9_]*$ is its own code name, unchanged, as before code names existed; any other key is lower-cased, with every run of characters other than a-z and 0-9 replaced by one underscore and underscores trimmed from both ends ('counterparty name' -> counterparty_name). Declare it when that rule gives no name of the form ^[a-z][a-z0-9_]*$. Two fields of one manifest (context and input together) may not share a code name. The input's code_name takes part only in that check (and is listed by GET /v1/functions): callers always pass the input as 'input'."
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "form": {
                    "enum": [
                      "fields",
                      "text"
                    ],
                    "description": "Required. fields: the state Jeff sends is an object of named fields, the context fields in the manifest's order and then the input under its key (the prompt shows the key). text: the adapter was trained on a state that is one plain string, so the state Jeff sends is the caller's input itself, unwrapped; the input must be a string, the manifest may have no context fields, and a call that passes context is refused (UnknownContext). With text the key appears nowhere in the prompt: it only gives the input its code name, which the function listing and the console use to name it."
                  }
                }
              },
              {
                "required": [
                  "code_name"
                ]
              }
            ],
            "description": "The function's input field (its own when the manifest declares it for the function, else the adapter's), with its code_name always given (declared or derived)."
          },
          "calibration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "data",
                  "rows",
                  "target_precision",
                  "threshold",
                  "precision_at_threshold",
                  "coverage_at_threshold"
                ],
                "properties": {
                  "data": {
                    "type": "string"
                  },
                  "data_mirror": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "path",
                      "sha256"
                    ],
                    "description": "Present when the calibration rows were read from a local copy of the data (the JEFF_DATA_MIRROR setting) instead of from where 'data' names, which stays the hf:// URI: the local file that was read (path) and its SHA-256 (sha256), so a refit elsewhere can tell whether it reads the same bytes. Absent: the rows were read from 'data' itself.",
                    "properties": {
                      "path": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$"
                      }
                    }
                  },
                  "rows": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "target_precision": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1
                  },
                  "threshold": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "precision_at_threshold": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "coverage_at_threshold": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                }
              }
            ]
          },
          "calibration_by_format": {
            "type": "object",
            "minProperties": 1,
            "propertyNames": {
              "minLength": 1
            },
            "description": "The function's calibration on other base formats, keyed by an INT4 base's format_id (its decision_config.json quantization.format_id): the threshold for exactly those INT4 weights, written by `jeff calibrate <function> --base <int4 folder>`. `calibration` stays the block for the bfloat16 base as released. A function with calibration null has no entries (it is uncalibrated in every format). An engine serving an INT4 base whose format_id has no entry here refuses to bind the function.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "data",
                "rows",
                "excluded",
                "target_precision",
                "threshold",
                "precision_at_threshold",
                "coverage_at_threshold"
              ],
              "properties": {
                "data": {
                  "type": "string"
                },
                "data_mirror": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "path",
                    "sha256"
                  ],
                  "description": "Present when the calibration rows were read from a local copy of the data (the JEFF_DATA_MIRROR setting) instead of from where 'data' names, which stays the hf:// URI: the local file that was read (path) and its SHA-256 (sha256), so a refit elsewhere can tell whether it reads the same bytes. Absent: the rows were read from 'data' itself.",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    }
                  }
                },
                "rows": {
                  "type": "integer",
                  "minimum": 1
                },
                "excluded": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Which calibration rows were left out of the fit, and why (the rows the quantiser saw, listed in the INT4 base's quantization.json)."
                },
                "target_precision": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 1
                },
                "threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "precision_at_threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "coverage_at_threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              }
            }
          },
          "adapter_version": {
            "type": "string"
          },
          "licence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "adapter"
            ],
            "properties": {
              "kind": {
                "enum": [
                  "open",
                  "proprietary"
                ]
              },
              "adapter": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        }
      }
    }
  }
}
401HTTP 401; see contract/errors.yaml for which error type(s) answer with this status.
Response schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "message",
        "details"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The JeffError subclass name, e.g. NotLicensed."
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "description": "The error's own extra attributes, if it has any (for example NotInstalled's function_id); empty for most errors."
        }
      }
    }
  }
}
429HTTP 429; see contract/errors.yaml for which error type(s) answer with this status.
Response schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "message",
        "details"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The JeffError subclass name, e.g. NotLicensed."
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "description": "The error's own extra attributes, if it has any (for example NotInstalled's function_id); empty for most errors."
        }
      }
    }
  }
}
500HTTP 500; see contract/errors.yaml for which error type(s) answer with this status.
Response schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "message",
        "details"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The JeffError subclass name, e.g. NotLicensed."
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "description": "The error's own extra attributes, if it has any (for example NotInstalled's function_id); empty for most errors."
        }
      }
    }
  }
}

Example

bash
curl -s -X GET https://api.jeffhub.ai/v1/functions \
  -H "Authorization: Bearer $JEFF_API_KEY"