Skip to main content
POST
/
models
/
v2
/
google
/
vit-base-patch16-224
image-classification
curl --request POST \
  --url https://api.bytez.com/models/v2/google/vit-base-patch16-224 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://www.padoniavets.com/sites/default/files/field/image/cats-and-dogs.jpg",
  "base64": "data:image/jpg;base64,...BASE_64_GOES_HERE (Only use this is you are not using a url)"
}
'
{
  "error": "<string>",
  "output": [
    {
      "label": "beagle",
      "score": 0.5398777723312378
    },
    {
      "label": "Egyptian cat",
      "score": 0.12709936499595642
    },
    {
      "label": "English foxhound",
      "score": 0.04305768758058548
    },
    {
      "label": "tabby, tabby cat",
      "score": 0.03387906029820442
    },
    {
      "label": "Walker hound, Walker foxhound",
      "score": 0.02507072128355503
    }
  ]
}

Authorizations

Authorization
string
header
required

Set Authorization header to BYTEZ_KEY 'Authorization: YOUR_BYTEZ_KEY_HERE'

Body

application/json

Schema for image-classification models

url
string
required
Example:

"https://www.padoniavets.com/sites/default/files/field/image/cats-and-dogs.jpg"

base64
string
Example:

"data:image/jpg;base64,...BASE_64_GOES_HERE (Only use this is you are not using a url)"

Response

Successful image-classification response.

error
string | null
required

Null on success; otherwise an error message.

output
array
required

Successful response with the classification labels

Example:
[
{
"label": "beagle",
"score": 0.5398777723312378
},
{
"label": "Egyptian cat",
"score": 0.12709936499595642
},
{
"label": "English foxhound",
"score": 0.04305768758058548
},
{
"label": "tabby, tabby cat",
"score": 0.03387906029820442
},
{
"label": "Walker hound, Walker foxhound",
"score": 0.02507072128355503
}
]