Trying to add custom mistral agent to telegram bot

hey there, trying to connect mistral ai custom agent to telegram bot

got 400 Bad Request Error on /v1/chat/completions API

I am trying to send a request to the https://api.mistral.ai/v1/chat/completions endpoint using the following JSON payload:

{
“model”: “mistral-small-2501”,
“agent_id”: “ag:5b5b439c:20250212:untitled-agent:51376fe6”,
“messages”: [
{
“role”: “user”,
“content”: “TEST”
}
],
“temperature”: 0.7
}



Oops resolved, i was using /v1/chat/completions instead of /v1/agents/completions :grimacing:

2 Likes

Great Post. Thank you! I am facing another problem. When trying to replicate your example with my agents I get an error 422 from minstral.ai. Agent is set up for API use and mistral connection generally works fine.
Can you give me a hint on how to debug this?