I have been searching the net for an answer, but I was not able to find a similair question nor answer. So here I am.
I am developing an app where a user can take a picture of a car and they will get back the car brand and possibly a model.
Currently I am using an API as a back-end to recieve the picture, the API will send the picture to a different API which can recognize the car + model. The response will be sent back to my API, I will sanitize the response and send it back to the app.
I was wondering if this would be a good structure or if I could do it like the picture below.
What I think might be better but less secure application flow:
My question here is, is it possible for the last application flow to be implemented so I don't have to send a picture twice, but I can just send a picture from my app directly to the API that is not mine, get the token back and get the response that way. My concern with this is that I will need to give people with an App my API_key so they can do requests to the Api that is not mine. There is the possibility of using oAuth1 but I don't know if my api key will be secure enough that way, any advice will be appreciated.
EDIT1 My sanitize function in my own back-end api is too big to implement in the App itself.