Custom header usage for REST API in private GPT

Hello There,

I’m quite new to the OpenAI-Ecosystem, and i’m making my first baby-steps, so please apologize if i’m stating something completely wrong.

I’m trying to build my own private GPT, that accesses my public hosted Grocy-Instance. The idea is to have an assistant, that creates recipes for me, but also can check the stock or update my shopping list.

So far, i was able to integrate the REST-API of grocy, by using a modified grocy.openapi.json. I use ActionGPT for that, to

  • dereference $ref simplifications and replace them by the full definition
  • provide operationId’s for each path
  • reduce the numer of API-Paths to only the one i need.

I then pasted the updated openapi spec and the actions could be created without problems.

I have these two actions currently:

Action Method Path Description
listEntities get /objects/{entity} GET entities from Grocy
createEntityObject post /objects/{entity} POST entities to Grocy

Currently, my assistant is perfectly able to access my instance via GET and retrieve informations like recipies and stock items. Now i wanted to push it to the next level and let and let my GPT create entities in the instance. But when i for instance let him create a quantity_unit the assistance always get’s an empty response {}.

I asked my assistant to provide me an CURL representation of the command and was prompted by the following:

curl -X POST https://grocy.mydomain.com/api/objects/quantity_units \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
    "entity": "quantity_units",
    "name": "DummyUnit",
    "plural_name": "DummyUnits",
    "active": 1
}'

which is techically wrong. Grocy requires you to use the custom header GROCY_API_KEY in combination with the API key.

When i run the CURL command from my command line i get the same result (when using -v with CURL, i get content-length of 0).

When i ask my assistant to retrieve data (via GET-Methods) apperently, it seem to work as i can see my recipies beeing listed by the gpt.

My question is: Why is my gpt using different types of headers for GET and POST? Or could there be another issue?

Michael;

PS: I had some links to referenes, but wasn’t allowed to post them

1 Like