To perform an image classfication please follow the example bellow:
{@html hljs.highlight(
					`let form = new FormData();
form.append('json_data', JSON.stringify({ id: '${model.id}' }));
form.append('file', file, 'file');

const headers = new Headers();
headers.append('response-type', 'application/json');
headers.append('token', token);

const r = await fetch('${window.location.protocol}//${window.location.hostname}/api/tasks/start/image', {
	method: 'POST',
	headers: headers,
	body: form
});`,
					{ language: 'javascript' }
				).value}
On Success the request will return a json with this format:
{@html hljs.highlight(
					`{ id	"00000000-0000-0000-0000-000000000000" }`,
					{ language: 'json' }
				).value}
This id can be used to query the API for the result of the task:
{@html hljs.highlight(
					`const headers = new Headers();
headers.append('content-type', 'application/json');
headers.append('token', token);

const r = await fetch('${window.location.protocol}//${window.location.hostname}/api/tasks/task', {
	method: 'POST',
	headers: headers,
	body: JSON.stringify({ id: '00000000-0000-0000-0000-000000000000' })
});`,
					{ language: 'javascript' }
				).value}
Once the task shows the status as 4 then the data can be obatined in the result field: The successful return value has this type:
{@html hljs.highlight(
					`{
    "id": string,
    "user_id": string,
    "model_id": string,
    "status": number,
    "status_message": string,
    "user_confirmed": number,
    "compacted": number,
    "type": number,
    "extra_task_info": string,
    "result": string,
    "created": string
}`,
					{ language: 'javascript' }
				).value}
Run image through them model and get the result
Upload image
Image selected
{#if run} {#await _result}

Processing Image!

{:then result} {#if result.status == 4} {@const res = JSON.parse(result.result)}

Result

The image was classified as {res.class} with confidence: {res.confidence}
{:else}

There was a problem running the task:

{result?.status_message}
{/if} {/await} {/if}