There must be an issue with your code. Can you show more? It looks like you’re using Java (wild guess). Are you using a client library?
For debugging it may make more sense to remove all optional parameters. Setting a max completion token for a JSON response doesn’t seem like a good time either.
Also. There is no thread key. If this is what you’re sending verbatim
Okay, I removed all of the optional parameters and it worked correctly (consuming 2150 in). So that makes me wonder if I’m formatting the request wrong? 3000 is enough as the total is only 2546. There are no examples in the API documentation for any of the optional bits. But what I posted above IS verbatim what I’m sending (other than the headers). Is there some other format that’s required?
I’m writing this in a Domino database, so I’m using lotuscript using the curl documentation. For this particular call, I’m using the Create Thread and Run process. I pull the thread_id and run_id from the initial response. And then when the status shows complete, I request the messages.
Edit: Okay, it isn’t exactly working… It is using the correct number of tokens, but it is returning the response as text rather than json. (Both the assistant itself, and the instructions specify json.) When I add the json parameter back to the API call, it ends up sending this: