https://www.boundaryml.com logo
BAML over REST: How does the client registry work?
# help
j
Hey, I'm currently working with the BAML REST API (
baml-cli serve
) and I'm trying to get the client registry to work. I add the following JSON to my
/call/...
request:
Copy code
json
"__baml_options__": {
    "client_registry": {
      "clients": {
        "name": "Default",
        "provider": "google-ai",
        "options": {
          "api_key": "my api key",
          "model": "gemini-2.5-flash"
        }
      },
      "primary": "Default"
    }
  }
But I get a parse error: "Failed to parse __baml_options__: invalid type: map, expected a sequence". Does anyone know what's going wrong here? It seems the API expects an array for
__baml_options__
but that goes against the API spec it generates. My BAML version is 0.207.1.
a
it seems that
clients
should be an array no?
j
...you're right 🤦‍♂️ This was a conversion from a php associative array to json, where there is no difference between an object and an array. Anyways thanks! There indeed is no question that's too dumb to ask
a
definitely not! happens to all. This is why we opted for making a DSL with good errors vs using json configs 🙂