A 500 error code means that there was an error. I’m not familiar with Java, but you should double-check that the base64 image data is being written properly to the request body.
Have you tried passing it through an API testing tool? Since the inference example web app uses the same API that you are using, I think it is likely it might be an implementation issue in Java/Android Studio.
To that end, could you double-check that the request method is properly set to POST and the image is properly encoded? In my own experience, I’ve had issues with 500 code errors when the request method is not properly set or if the image was not being encoded properly.
If it’s helpful, here’s a Java OkHttp code sample from Postman of a successful request to your model.
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "*base54*");
Request request = new Request.Builder()
.url("https://classify.roboflow.com//mental-health-drawing/1?api_key=REMOVED")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();